Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.store.service; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | import java.util.Map; |
| 20 | import java.util.Set; |
Madan Jampani | fa24218 | 2016-01-22 13:42:54 -0800 | [diff] [blame] | 21 | import java.util.concurrent.CompletableFuture; |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 22 | import java.util.function.BiFunction; |
| 23 | |
Madan Jampani | a090a11 | 2016-01-18 16:38:17 -0800 | [diff] [blame] | 24 | import org.onosproject.store.service.DistributedPrimitive.Type; |
| 25 | |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 26 | /** |
| 27 | * Testing adapter for EventuallyConsistentMap. |
| 28 | */ |
| 29 | public class EventuallyConsistentMapAdapter<K, V> implements EventuallyConsistentMap<K, V> { |
Madan Jampani | a090a11 | 2016-01-18 16:38:17 -0800 | [diff] [blame] | 30 | |
| 31 | @Override |
| 32 | public String name() { |
| 33 | return null; |
| 34 | } |
| 35 | |
| 36 | @Override |
Madan Jampani | 39fff10 | 2016-02-14 13:17:28 -0800 | [diff] [blame] | 37 | public Type primitiveType() { |
Madan Jampani | a090a11 | 2016-01-18 16:38:17 -0800 | [diff] [blame] | 38 | return Type.EVENTUALLY_CONSISTENT_MAP; |
| 39 | } |
| 40 | |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 41 | @Override |
| 42 | public int size() { |
| 43 | return 0; |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | public boolean isEmpty() { |
| 48 | return false; |
| 49 | } |
| 50 | |
| 51 | @Override |
| 52 | public boolean containsKey(K key) { |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | @Override |
| 57 | public boolean containsValue(V value) { |
| 58 | return false; |
| 59 | } |
| 60 | |
| 61 | @Override |
| 62 | public V get(K key) { |
| 63 | return null; |
| 64 | } |
| 65 | |
| 66 | @Override |
| 67 | public void put(K key, V value) { |
| 68 | |
| 69 | } |
| 70 | |
| 71 | @Override |
| 72 | public V remove(K key) { |
| 73 | return null; |
| 74 | } |
| 75 | |
| 76 | @Override |
| 77 | public void remove(K key, V value) { |
| 78 | |
| 79 | } |
| 80 | |
| 81 | @Override |
| 82 | public V compute(K key, BiFunction<K, V, V> recomputeFunction) { |
| 83 | return null; |
| 84 | } |
| 85 | |
| 86 | @Override |
| 87 | public void putAll(Map<? extends K, ? extends V> m) { |
| 88 | |
| 89 | } |
| 90 | |
| 91 | @Override |
| 92 | public void clear() { |
| 93 | |
| 94 | } |
| 95 | |
| 96 | @Override |
| 97 | public Set<K> keySet() { |
| 98 | return null; |
| 99 | } |
| 100 | |
| 101 | @Override |
| 102 | public Collection<V> values() { |
| 103 | return null; |
| 104 | } |
| 105 | |
| 106 | @Override |
| 107 | public Set<Map.Entry<K, V>> entrySet() { |
| 108 | return null; |
| 109 | } |
| 110 | |
| 111 | @Override |
| 112 | public void addListener(EventuallyConsistentMapListener<K, V> listener) { |
| 113 | |
| 114 | } |
| 115 | |
| 116 | @Override |
| 117 | public void removeListener(EventuallyConsistentMapListener<K, V> listener) { |
| 118 | |
| 119 | } |
| 120 | |
| 121 | @Override |
Madan Jampani | fa24218 | 2016-01-22 13:42:54 -0800 | [diff] [blame] | 122 | public CompletableFuture<Void> destroy() { |
| 123 | return CompletableFuture.completedFuture(null); |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 124 | } |
| 125 | } |