2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.io.hueemulation.internal.rest.mocks;
15 import java.util.Collection;
17 import java.util.TreeMap;
19 import org.eclipse.jdt.annotation.NonNull;
20 import org.eclipse.jdt.annotation.Nullable;
21 import org.openhab.core.storage.Storage;
22 import org.openhab.io.hueemulation.internal.dto.HueUserAuthWithSecrets;
25 * @author David Graeff - Initial contribution
27 public class DummyUsersStorage implements Storage<HueUserAuthWithSecrets> {
28 Map<String, HueUserAuthWithSecrets> users = new TreeMap<>();
30 public DummyUsersStorage() {
31 users.put("testuser", new HueUserAuthWithSecrets("appname", "devicename", "testuser", "clientkey"));
35 public @Nullable HueUserAuthWithSecrets put(String key, @Nullable HueUserAuthWithSecrets value) {
36 return users.put(key, value);
40 public @Nullable HueUserAuthWithSecrets remove(String key) {
41 return users.remove(key);
45 public boolean containsKey(String key) {
46 return users.containsKey(key);
50 public @Nullable HueUserAuthWithSecrets get(String key) {
51 return users.get(key);
55 public Collection<@NonNull String> getKeys() {
56 return users.keySet();
60 public Collection<@Nullable HueUserAuthWithSecrets> getValues() {
61 return users.values();