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.binding.bosesoundtouch.internal.handler;
15 import java.util.Collection;
17 import java.util.TreeMap;
19 import org.eclipse.jdt.annotation.NonNull;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.eclipse.jdt.annotation.Nullable;
22 import org.openhab.binding.bosesoundtouch.internal.ContentItem;
23 import org.openhab.core.storage.Storage;
26 * @author Leo Siepel - Initial contribution
29 public class InMemmoryContentStorage implements Storage<ContentItem> {
30 Map<String, @Nullable ContentItem> items = new TreeMap<>();
32 public InMemmoryContentStorage() {
36 public @Nullable ContentItem put(String key, @Nullable ContentItem value) {
37 return items.put(key, value);
41 public @Nullable ContentItem remove(String key) {
42 return items.remove(key);
46 public boolean containsKey(String key) {
47 return items.containsKey(key);
51 public @Nullable ContentItem get(String key) {
52 return items.get(key);
56 public Collection<@NonNull String> getKeys() {
57 return items.keySet();
61 public Collection<@Nullable ContentItem> getValues() {
62 return items.values();