Package org.kiwiproject.collect
Class KiwiSets
- java.lang.Object
-
- org.kiwiproject.collect.KiwiSets
-
-
Constructor Summary
Constructors Constructor Description KiwiSets()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> booleanhasOneElement(Set<T> set)Checks whether the specified list is non-null and has only one item.static <T> booleanisNotNullOrEmpty(Set<T> set)Checks whether the specified is neither null nor empty.static <T> booleanisNullOrEmpty(Set<T> set)Checks whether the specified set is null or empty.
-
-
-
Method Detail
-
isNullOrEmpty
public static <T> boolean isNullOrEmpty(Set<T> set)
Checks whether the specified set is null or empty.- Type Parameters:
T- the type of items in the set- Parameters:
set- the set- Returns:
trueif set is null or empty;falseotherwise
-
isNotNullOrEmpty
public static <T> boolean isNotNullOrEmpty(Set<T> set)
Checks whether the specified is neither null nor empty.- Type Parameters:
T- the type of items in the set- Parameters:
set- the set- Returns:
trueif set is neither null nor empty;falseotherwise
-
hasOneElement
public static <T> boolean hasOneElement(Set<T> set)
Checks whether the specified list is non-null and has only one item.- Type Parameters:
T- the type of items in the set- Parameters:
set- the set- Returns:
trueif list is non-null and has exactly one item;false
-
-