Class CollectionUtil
java.lang.Object
com.github.hypfvieh.util.CollectionUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetFirstOrDefault(Collection<T> _items, T _default) Returns the first element in the collection or the default value if collection isnullor empty.static booleanhasValue(Collection<?> _coll) Verifies if given collection has any value.static <T> List<T> mutableListOf(T... _items) Creates a mutable List of items.
-
Method Details
-
hasValue
Verifies if given collection has any value.- Parameters:
_coll- collection- Returns:
- true if given collection is not
nulland contains any value
-
mutableListOf
Creates a mutable List of items.- Type Parameters:
T- Type- Parameters:
_items- Items to add- Returns:
- ArrayList
-
getFirstOrDefault
Returns the first element in the collection or the default value if collection isnullor empty.- Type Parameters:
T- type- Parameters:
_items- collection with elements_default- default if collection is empty/null- Returns:
- first element of collection or default
-