IterUtil
Source
The methods in this utility class were originally in CollUtil, but they were extracted and abstracted to adapt to a wider range of scenarios.
Method Introduction
isEmpty
Whether it is null or emptyisNotEmpty
Whether it is non-null and contains at least one elementhasNull
Whether there are null elementsisAllNull
Whether all elements are nullcountMap
Returns a Map of element counts based on a collection. Element counts refer to the number of times an element appears in the collection, where the element is used as the key and the count is used as the value.join
Converts a collection to a string using a separatortoMap
Converts a list of entries or separate lists of keys and values to a MapasIterator
Converts an enumeration to an iteratorasIterable
Converts an iterator to an iterablegetFirst
Gets the first element from a listgetElementType
Gets the element type