Package org.onosproject.store.primitives
Class MapUpdate<K,V>
- java.lang.Object
-
- org.onosproject.store.primitives.MapUpdate<K,V>
-
- Type Parameters:
K- map key typeV- map value type
public final class MapUpdate<K,V> extends java.lang.ObjectMap update operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapUpdate.Builder<K,V>MapUpdate builder.static classMapUpdate.TypeType of database update operation.
-
Constructor Summary
Constructors Constructor Description MapUpdate()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object object)inthashCode()Kkey()Returns the item key being updated.<S,T>
MapUpdate<S,T>map(java.util.function.Function<K,S> keyMapper, java.util.function.Function<V,T> valueMapper)Transforms this instance into an instance of different parameterized types.static <K,V>
MapUpdate.Builder<K,V>newBuilder()Creates a new builder instance.java.lang.StringtoString()MapUpdate.Typetype()Returns the type of update operation.Vvalue()Returns the new value.longversion()Returns the expected current version in the database for the key.
-
-
-
Method Detail
-
type
public MapUpdate.Type type()
Returns the type of update operation.- Returns:
- type of update.
-
key
public K key()
Returns the item key being updated.- Returns:
- item key
-
value
public V value()
Returns the new value.- Returns:
- item's target value.
-
version
public long version()
Returns the expected current version in the database for the key.- Returns:
- expected version.
-
map
public <S,T> MapUpdate<S,T> map(java.util.function.Function<K,S> keyMapper, java.util.function.Function<V,T> valueMapper)
Transforms this instance into an instance of different parameterized types.- Type Parameters:
S- key type of returned instanceT- value type of returned instance- Parameters:
keyMapper- transcoder for key typevalueMapper- transcoder to value type- Returns:
- new instance
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
newBuilder
public static <K,V> MapUpdate.Builder<K,V> newBuilder()
Creates a new builder instance.- Type Parameters:
K- key typeV- value type- Returns:
- builder.
-
-