Package com.naver.ads.util
Object CollectionUtils
-
- All Implemented Interfaces:
public class CollectionUtilsMiscellaneous Collection utility methods.
-
-
Field Summary
Fields Modifier and Type Field Description public final static CollectionUtilsINSTANCE
-
Method Summary
Modifier and Type Method Description final static BooleanisEmpty(Collection<?> collection)Null-safe check if the specified Collection is empty. final static BooleanisEmpty(Map<?, ?> map)Null-safe check if the specified Map is empty. final static BooleanisNotEmpty(Collection<?> collection)Null-safe check if the specified Collection is not empty. final static BooleanisNotEmpty(Map<?, ?> map)Null-safe check if the specified Map is not empty. final static <T extends Any> Set<T>defaultIfEmpty(Set<T> set, Set<T> defaultSet)Returns defaultSet if the given set is null or empty; otherwise set. final static <T extends Any> List<T>defaultIfEmpty(List<T> list, List<T> defaultList)Returns defaultList if the given list is null or empty; otherwise list. final static <K extends Any, V extends Any> Map<K, V>defaultIfEmpty(Map<K, V> map, Map<K, V> defaultMap)Returns defaultMap if the given map is null or empty; otherwise map. final static List<String>toNotBlankStringList(String args)Create and return a list of not blank strings from the given args. -
-
Method Detail
-
isEmpty
@SinceKotlin(version = "999.9") final static Boolean isEmpty(Collection<?> collection)
Null-safe check if the specified Collection is empty.
-
isEmpty
@SinceKotlin(version = "999.9") final static Boolean isEmpty(Map<?, ?> map)
Null-safe check if the specified Map is empty.
-
isNotEmpty
@SinceKotlin(version = "999.9") final static Boolean isNotEmpty(Collection<?> collection)
Null-safe check if the specified Collection is not empty.
-
isNotEmpty
@SinceKotlin(version = "999.9") final static Boolean isNotEmpty(Map<?, ?> map)
Null-safe check if the specified Map is not empty.
-
defaultIfEmpty
@SinceKotlin(version = "999.9") final static <T extends Any> Set<T> defaultIfEmpty(Set<T> set, Set<T> defaultSet)
Returns defaultSet if the given set is null or empty; otherwise set.
-
defaultIfEmpty
@SinceKotlin(version = "999.9") final static <T extends Any> List<T> defaultIfEmpty(List<T> list, List<T> defaultList)
Returns defaultList if the given list is null or empty; otherwise list.
-
defaultIfEmpty
@SinceKotlin(version = "999.9") final static <K extends Any, V extends Any> Map<K, V> defaultIfEmpty(Map<K, V> map, Map<K, V> defaultMap)
Returns defaultMap if the given map is null or empty; otherwise map.
-
toNotBlankStringList
final static List<String> toNotBlankStringList(String args)
Create and return a list of not blank strings from the given args.
-
-
-
-