Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -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; |
Jordan Halterman | 8c47358 | 2018-07-03 00:00:47 -0700 | [diff] [blame] | 19 | import java.util.Iterator; |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 20 | import java.util.Map; |
| 21 | import java.util.Set; |
Madan Jampani | 0463cf9 | 2016-05-04 14:46:08 -0700 | [diff] [blame] | 22 | import java.util.concurrent.Executor; |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 23 | import java.util.function.BiFunction; |
| 24 | import java.util.function.Function; |
| 25 | import java.util.function.Predicate; |
| 26 | |
| 27 | /** |
| 28 | * Testing adapter for the consistent map. |
| 29 | */ |
| 30 | public class ConsistentMapAdapter<K, V> implements ConsistentMap<K, V> { |
Madan Jampani | a090a11 | 2016-01-18 16:38:17 -0800 | [diff] [blame] | 31 | |
| 32 | @Override |
| 33 | public String name() { |
| 34 | return null; |
| 35 | } |
| 36 | |
| 37 | @Override |
Madan Jampani | 39fff10 | 2016-02-14 13:17:28 -0800 | [diff] [blame] | 38 | public DistributedPrimitive.Type primitiveType() { |
Madan Jampani | a090a11 | 2016-01-18 16:38:17 -0800 | [diff] [blame] | 39 | return DistributedPrimitive.Type.CONSISTENT_MAP; |
| 40 | } |
| 41 | |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 42 | @Override |
| 43 | public int size() { |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | @Override |
| 48 | public boolean isEmpty() { |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | @Override |
| 53 | public boolean containsKey(K key) { |
| 54 | return false; |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public boolean containsValue(V value) { |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public Versioned<V> get(K key) { |
| 64 | return null; |
| 65 | } |
| 66 | |
| 67 | @Override |
Jordan Halterman | f627244 | 2017-04-20 02:18:08 -0700 | [diff] [blame] | 68 | public Versioned<V> getOrDefault(K key, V defaultValue) { |
| 69 | return null; |
| 70 | } |
| 71 | |
| 72 | @Override |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 73 | public Versioned<V> computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) { |
| 74 | return null; |
| 75 | } |
| 76 | |
| 77 | @Override |
| 78 | public Versioned<V> compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { |
| 79 | return null; |
| 80 | } |
| 81 | |
| 82 | @Override |
| 83 | public Versioned<V> computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { |
| 84 | return null; |
| 85 | } |
| 86 | |
| 87 | @Override |
| 88 | public Versioned<V> computeIf(K key, Predicate<? super V> condition, |
| 89 | BiFunction<? super K, ? super V, ? extends V> remappingFunction) { |
| 90 | return null; |
| 91 | } |
| 92 | |
| 93 | @Override |
| 94 | public Versioned<V> put(K key, V value) { |
| 95 | return null; |
| 96 | } |
| 97 | |
| 98 | @Override |
| 99 | public Versioned<V> putAndGet(K key, V value) { |
| 100 | return null; |
| 101 | } |
| 102 | |
| 103 | @Override |
| 104 | public Versioned<V> remove(K key) { |
| 105 | return null; |
| 106 | } |
| 107 | |
| 108 | @Override |
| 109 | public void clear() { |
| 110 | |
| 111 | } |
| 112 | |
| 113 | @Override |
| 114 | public Set<K> keySet() { |
| 115 | return null; |
| 116 | } |
| 117 | |
| 118 | @Override |
| 119 | public Collection<Versioned<V>> values() { |
| 120 | return null; |
| 121 | } |
| 122 | |
| 123 | @Override |
| 124 | public Set<Map.Entry<K, Versioned<V>>> entrySet() { |
| 125 | return null; |
| 126 | } |
| 127 | |
| 128 | @Override |
| 129 | public Versioned<V> putIfAbsent(K key, V value) { |
| 130 | return null; |
| 131 | } |
| 132 | |
| 133 | @Override |
| 134 | public boolean remove(K key, V value) { |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | @Override |
| 139 | public boolean remove(K key, long version) { |
| 140 | return false; |
| 141 | } |
| 142 | |
| 143 | @Override |
Jihwan Kim | 9887ad9 | 2015-12-12 00:23:57 +0900 | [diff] [blame] | 144 | public Versioned<V> replace(K key, V value) { |
| 145 | return null; |
| 146 | } |
| 147 | |
| 148 | @Override |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 149 | public boolean replace(K key, V oldValue, V newValue) { |
| 150 | return false; |
| 151 | } |
| 152 | |
| 153 | @Override |
| 154 | public boolean replace(K key, long oldVersion, V newValue) { |
| 155 | return false; |
| 156 | } |
| 157 | |
| 158 | @Override |
Jordan Halterman | 8c47358 | 2018-07-03 00:00:47 -0700 | [diff] [blame] | 159 | public Iterator<Map.Entry<K, Versioned<V>>> iterator() { |
| 160 | return null; |
| 161 | } |
| 162 | |
| 163 | @Override |
Madan Jampani | 0463cf9 | 2016-05-04 14:46:08 -0700 | [diff] [blame] | 164 | public void addListener(MapEventListener<K, V> listener, Executor executor) { |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 165 | |
| 166 | } |
| 167 | |
| 168 | @Override |
| 169 | public void removeListener(MapEventListener<K, V> listener) { |
| 170 | |
| 171 | } |
Madan Jampani | e106522 | 2015-08-17 16:21:51 -0700 | [diff] [blame] | 172 | |
| 173 | @Override |
| 174 | public Map<K, V> asJavaMap() { |
| 175 | return null; |
| 176 | } |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 177 | } |