K - The type of the key or left object.V - The type of the value or right object.public class Pair<K,V>
extends java.lang.Object
implements java.util.Map.Entry<K,V>
MapperUtils methods. It can be referred to directly
since it is a public class, although to avoid dependencies on it, it may be wise to just refer to its type as the
Java Map.Entry interface. This will allow you to only to use the getKey() and
getValue() methods, however, they are functionally the same as getLeft() and getRight().| Modifier and Type | Method and Description |
|---|---|
K |
getKey()
Getter for the map entry key, or left object in the pair.
|
K |
getLeft()
Getter for the map entry key, or left object in the pair.
|
V |
getRight()
Getter for the map entry value, or right object in the pair.
|
V |
getValue()
Getter for the map entry value, or right object in the pair.
|
static <K,V> Pair<K,V> |
of(K key,
V value)
Builds an object of this type using the given
key and value instances. |
V |
setValue(V value)
Because this is an immutable map entry object, this method is not unsupported.
|
public static <K,V> Pair<K,V> of(K key, V value)
key and value instances.K - The type of the key or left object.V - The type of the value or right object.key - The key of the map entry, or left object in the pair.value - The value of the map entry, or right object in the pair.public K getKey()
public V getValue()
public V setValue(V value)
public K getLeft()
public V getRight()