Package com.adobe.marketing.mobile.util
Class MapUtils
-
- All Implemented Interfaces:
public final class MapUtilsUtility class for Maps
-
-
Method Summary
Modifier and Type Method Description static booleanisNullOrEmpty(@Nullable() Map<out Object, out Object> map)Checks if the provided mapis null or it has no elementstatic voidputIfNotEmpty(@Nullable() Map<String, Object> map, @Nullable() String key, @Nullable() Object value)Adds key/valuetomapifvalueis not null or an empty string, map or collection.-
-
Method Detail
-
isNullOrEmpty
static boolean isNullOrEmpty(@Nullable() Map<out Object, out Object> map)
Checks if the provided
mapis null or it has no element- Parameters:
map- themapto be verified- Returns:
true if null or empty, false otherwise
-
putIfNotEmpty
static void putIfNotEmpty(@Nullable() Map<String, Object> map, @Nullable() String key, @Nullable() Object value)
Adds
key/valuetomapifvalueis not null or an empty string, map or collection.- Parameters:
map- collection to putvaluesmapped tokeyifvaluesis non-null and contains at least one entrykey- key used to mapvalueinmapvalue- an object to add tomapif not null or empty
-
-
-
-