public class Util
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
contains(java.util.Collection<T> collection,
T item)
Typed contains test.
|
static <K,V> boolean |
containsKey(java.util.Map<K,V> map,
K key)
Typed map key test operation.
|
static <T> boolean |
equals(T t1,
T t2)
Typed equality operation.
|
static <K,V> V |
get(java.util.Map<K,V> map,
K key)
Typed map get operation.
|
static <K,V> V |
remove(java.util.Map<K,V> map,
K key)
Typed map remove operation.
|
public static <K,V> V get(java.util.Map<K,V> map, K key)
Map.get(Object)
,
but it provides compile-time assurance that the supplied key
has the right type.map
- mapkey
- keypublic static <K,V> boolean containsKey(java.util.Map<K,V> map, K key)
Map.containsKey(Object)
,
but it provides compile-time assurance that the supplied key
has the right type.map
- mapkey
- keypublic static <K,V> V remove(java.util.Map<K,V> map, K key)
Map.remove(Object)
,
but it provides compile-time assurance that the supplied key
has the right type.map
- mapkey
- keypublic static <T> boolean equals(T t1, T t2)
Objects.equals(Object,Object)
,
but provides compile-time assurance that the two supplied parameters
have the same type.t1
- first objectt2
- second objectpublic static <T> boolean contains(java.util.Collection<T> collection, T item)
Collection.contains(java.lang.Object)
,
but provides compile-time assurance that the item's type is
compatible with the collection.collection
- collectionitem
- item