Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -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 | 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; |
| 19 | import java.util.Map; |
| 20 | import java.util.Set; |
Madan Jampani | 0463cf9 | 2016-05-04 14:46:08 -0700 | [diff] [blame] | 21 | import java.util.concurrent.Executor; |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 22 | import java.util.function.BiFunction; |
| 23 | import java.util.function.Function; |
| 24 | import java.util.function.Predicate; |
| 25 | |
| 26 | /** |
| 27 | * Testing adapter for the consistent map. |
| 28 | */ |
| 29 | public class ConsistentMapAdapter<K, V> implements ConsistentMap<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 DistributedPrimitive.Type primitiveType() { |
Madan Jampani | a090a11 | 2016-01-18 16:38:17 -0800 | [diff] [blame] | 38 | return DistributedPrimitive.Type.CONSISTENT_MAP; |
| 39 | } |
| 40 | |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -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 Versioned<V> get(K key) { |
| 63 | return null; |
| 64 | } |
| 65 | |
| 66 | @Override |
| 67 | public Versioned<V> computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) { |
| 68 | return null; |
| 69 | } |
| 70 | |
| 71 | @Override |
| 72 | public Versioned<V> compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { |
| 73 | return null; |
| 74 | } |
| 75 | |
| 76 | @Override |
| 77 | public Versioned<V> computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { |
| 78 | return null; |
| 79 | } |
| 80 | |
| 81 | @Override |
| 82 | public Versioned<V> computeIf(K key, Predicate<? super V> condition, |
| 83 | BiFunction<? super K, ? super V, ? extends V> remappingFunction) { |
| 84 | return null; |
| 85 | } |
| 86 | |
| 87 | @Override |
| 88 | public Versioned<V> put(K key, V value) { |
| 89 | return null; |
| 90 | } |
| 91 | |
| 92 | @Override |
| 93 | public Versioned<V> putAndGet(K key, V value) { |
| 94 | return null; |
| 95 | } |
| 96 | |
| 97 | @Override |
| 98 | public Versioned<V> remove(K key) { |
| 99 | return null; |
| 100 | } |
| 101 | |
| 102 | @Override |
| 103 | public void clear() { |
| 104 | |
| 105 | } |
| 106 | |
| 107 | @Override |
| 108 | public Set<K> keySet() { |
| 109 | return null; |
| 110 | } |
| 111 | |
| 112 | @Override |
| 113 | public Collection<Versioned<V>> values() { |
| 114 | return null; |
| 115 | } |
| 116 | |
| 117 | @Override |
| 118 | public Set<Map.Entry<K, Versioned<V>>> entrySet() { |
| 119 | return null; |
| 120 | } |
| 121 | |
| 122 | @Override |
| 123 | public Versioned<V> putIfAbsent(K key, V value) { |
| 124 | return null; |
| 125 | } |
| 126 | |
| 127 | @Override |
| 128 | public boolean remove(K key, V value) { |
| 129 | return false; |
| 130 | } |
| 131 | |
| 132 | @Override |
| 133 | public boolean remove(K key, long version) { |
| 134 | return false; |
| 135 | } |
| 136 | |
| 137 | @Override |
Jihwan Kim | 9887ad9 | 2015-12-12 00:23:57 +0900 | [diff] [blame] | 138 | public Versioned<V> replace(K key, V value) { |
| 139 | return null; |
| 140 | } |
| 141 | |
| 142 | @Override |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 143 | public boolean replace(K key, V oldValue, V newValue) { |
| 144 | return false; |
| 145 | } |
| 146 | |
| 147 | @Override |
| 148 | public boolean replace(K key, long oldVersion, V newValue) { |
| 149 | return false; |
| 150 | } |
| 151 | |
| 152 | @Override |
Madan Jampani | 0463cf9 | 2016-05-04 14:46:08 -0700 | [diff] [blame] | 153 | public void addListener(MapEventListener<K, V> listener, Executor executor) { |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 154 | |
| 155 | } |
| 156 | |
| 157 | @Override |
| 158 | public void removeListener(MapEventListener<K, V> listener) { |
| 159 | |
| 160 | } |
Madan Jampani | e106522 | 2015-08-17 16:21:51 -0700 | [diff] [blame] | 161 | |
| 162 | @Override |
| 163 | public Map<K, V> asJavaMap() { |
| 164 | return null; |
| 165 | } |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 166 | } |