Class EventDataUtils

  • All Implemented Interfaces:

    
    public class EventDataUtils
    
                        

    Utility 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • 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 as HashMap<String, Object>.

        • Entry with null key is dropped.
        • Entry with non String key is converted to entry with String key by calling toString method.
        Values which are Collection<?> are cloned as ArrayList<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 unmodifiable HashMap<String, Object>.

        • Entry with null key is dropped.
        • Entry with non String key is converted to entry with String key by calling toString method.
        Values which are Collection<?> are cloned as unmodifiable ArrayList<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<?, ?> to HashMap<String, Object>

        • Entry with null and non String key is dropped.
        • Entry withnon String key is dropped
        Parameters:
        map - map to be cast
        Returns:

        map cast to type Map<String, Object>