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.Object
Map update operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapUpdate.Builder<K,V>
MapUpdate builder.static class
MapUpdate.Type
Type 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 boolean
equals(java.lang.Object object)
int
hashCode()
K
key()
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.String
toString()
MapUpdate.Type
type()
Returns the type of update operation.V
value()
Returns the new value.long
version()
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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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.
-
-