K - keyV - valuepublic static class ImmutableMap.ImmutableEntry<K,V> extends Object
| Constructor and Description |
|---|
ImmutableEntry(Map.Entry<K,V> wrappedEntry) |
| Modifier and Type | Method and Description |
|---|---|
static <K extends Comparable<? super K>,V> |
comparingByKey()
Returns a comparator that compares
ImmutableMap.ImmutableEntry in natural order on key. |
static <K,V> Comparator<ImmutableMap.ImmutableEntry<K,V>> |
comparingByKey(Comparator<? super K> cmp)
Returns a comparator that compares
ImmutableMap.ImmutableEntry by key using the given Comparator. |
static <K,V extends Comparable<? super V>> |
comparingByValue()
Returns a comparator that compares
ImmutableMap.ImmutableEntry in natural order on value. |
static <K,V> Comparator<ImmutableMap.ImmutableEntry<K,V>> |
comparingByValue(Comparator<? super V> cmp)
Returns a comparator that compares
ImmutableMap.ImmutableEntry by value using the given Comparator. |
boolean |
equals(Object obj) |
K |
getKey()
Returns the key corresponding to this entry.
|
V |
getValue()
Returns the value corresponding to this entry.
|
int |
hashCode() |
public K getKey()
IllegalStateException - implementations may, but are not required to, throw this exception if the entry has
been removed from the backing map.public V getValue()
IllegalStateException - implementations may, but are not required to, throw this exception if the entry has
been removed from the backing map.public static <K extends Comparable<? super K>,V> Comparator<ImmutableMap.ImmutableEntry<K,V>> comparingByKey()
ImmutableMap.ImmutableEntry in natural order on key.
The returned comparator is serializable and throws NullPointerException when comparing an entry with a null
key.
K - the Comparable type of then map keysV - the type of the map valuesImmutableMap.ImmutableEntry in natural order on key.Comparablepublic static <K,V extends Comparable<? super V>> Comparator<ImmutableMap.ImmutableEntry<K,V>> comparingByValue()
ImmutableMap.ImmutableEntry in natural order on value.
The returned comparator is serializable and throws NullPointerException when comparing an entry with null
values.
K - the type of the map keysV - the Comparable type of the map valuesImmutableMap.ImmutableEntry in natural order on value.Comparablepublic static <K,V> Comparator<ImmutableMap.ImmutableEntry<K,V>> comparingByKey(Comparator<? super K> cmp)
ImmutableMap.ImmutableEntry by key using the given Comparator.
The returned comparator is serializable if the specified comparator is also serializable.
K - the type of the map keysV - the type of the map valuescmp - the key ComparatorImmutableMap.ImmutableEntry by the key.public static <K,V> Comparator<ImmutableMap.ImmutableEntry<K,V>> comparingByValue(Comparator<? super V> cmp)
ImmutableMap.ImmutableEntry by value using the given Comparator.
The returned comparator is serializable if the specified comparator is also serializable.
K - the type of the map keysV - the type of the map valuescmp - the value ComparatorImmutableMap.ImmutableEntry by the value.Copyright © 2018–2019 Delft University of Technology. All rights reserved.