com.hazelcast.util
Class CollectionUtil

java.lang.Object
  extended by com.hazelcast.util.CollectionUtil

public final class CollectionUtil
extends Object

Various collection utility methods, mainly targeted to use internally.


Method Summary
static
<K,V> List<V>
addToValueList(Map<K,List<V>> map, K key, V value)
          Add value to list of values in the map.
static boolean isEmpty(Collection collection)
          Returns true if the given collection is null or empty, otherwise returns false.
static boolean isNotEmpty(Collection collection)
          Returns true if the given collection is not null and not empty, otherwise returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEmpty

public static boolean isEmpty(Collection collection)
Returns true if the given collection is null or empty, otherwise returns false.

Parameters:
collection - the given collection.
Returns:
true if collection is empty.

isNotEmpty

public static boolean isNotEmpty(Collection collection)
Returns true if the given collection is not null and not empty, otherwise returns false.

Parameters:
collection - the given collection.
Returns:
true if collection is not empty.

addToValueList

public static <K,V> List<V> addToValueList(Map<K,List<V>> map,
                                           K key,
                                           V value)
Add value to list of values in the map. Creates a new list if it doesn't exist for the key

Parameters:
map -
key -
value -
Returns:
the updated list of values.


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.