Package com.adobe.marketing.mobile.util
Class EventDataUtils
-
- All Implemented Interfaces:
public class EventDataUtilsUtility to clone event data which is represented as
Map<String, Object>. Currently supports cloning values which are Boolean, Byte, Short, Integer, Long, Float, Double, BigDecimal, BigInteger, Character, String, UUID, Maps and Collections.
-
-
Method Summary
Modifier and Type Method Description static Map<String, Object>clone(Map<String, out Object> map)Deep clones the provided map. static Map<String, Object>immutableClone(Map<String, out Object> map)Deep clones the provided map. static Map<String, Object>castFromGenericType(Map<out Object, out Object> map)Casts generic map Map<?, ?>toHashMap<String, Object>- Entry with null and non
Stringkey is dropped. - Entry withnon
Stringkey is dropped
-
-
Method Detail
-
clone
static Map<String, Object> clone(Map<String, out Object> map)
Deep clones the provided map. Support cloning values which are basic types, maps and collections. Values which are
Map<?, ?>are cloned asHashMap<String, Object>.- Entry with null key is dropped.
- Entry with non
Stringkey is converted to entry withStringkey by calling toString method.
Collection<?>are cloned asArrayList<Object>.- Parameters:
map- map to be cloned- Returns:
Cloned map
-
immutableClone
static Map<String, Object> immutableClone(Map<String, out Object> map)
Deep clones the provided map. Support cloning values which are basic types, maps and collections. Values which are
Map<?, ?>are cloned as unmodifiableHashMap<String, Object>.- Entry with null key is dropped.
- Entry with non
Stringkey is converted to entry withStringkey by calling toString method.
Collection<?>are cloned as unmodifiableArrayList<Object>.- Parameters:
map- map to be cloned- Returns:
Cloned immutable map
-
castFromGenericType
static Map<String, Object> castFromGenericType(Map<out Object, out Object> map)
Casts generic map
Map<?, ?>toHashMap<String, Object>- Entry with null and non
Stringkey is dropped. - Entry withnon
Stringkey is dropped
- Parameters:
map- map to be cast- Returns:
map cast to type
Map<String, Object>
- Entry with null and non
-
-
- Entry with null and non
-