Class BaseTypesMap<K,​V>

  • Type Parameters:
    K - The key type, usually String
    V - The value type, usually Object
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<K,​V>
    Direct Known Subclasses:
    MessageMetadata, PropertyMap

    public class BaseTypesMap<K,​V>
    extends java.util.LinkedHashMap<K,​V>
    implements java.io.Serializable
    A LinkedHashMap that checks the type of all keys and values against a set of predefined data types in VALID_CLASSES.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BaseTypesMap.BaseTypesEntry  
      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseTypesMap()
      Default constructor.
      BaseTypesMap​(int initialCapacity)
      Constructor that takes an initial capacity.
      BaseTypesMap​(java.util.Map<? extends K,​? extends V> m)
      Create a new base types map from the existing map.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkType​(java.lang.Object obj)
      Checks the type of obj for null or one of the valid types, otherwise throws an IllegalArgumentException.
      BaseTypesMap<K,​V> clone()
      Performs a deep clone of this map.
      BaseTypesMap.BaseTypesEntry[] getEntries()  
      V put​(K key, V value)  
      void putAll​(java.util.Map<? extends K,​? extends V> m)  
      void setEntries​(BaseTypesMap.BaseTypesEntry[] entries)  
      • Methods inherited from class java.util.LinkedHashMap

        clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
      • Methods inherited from class java.util.HashMap

        compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, size
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, size
    • Constructor Detail

      • BaseTypesMap

        public BaseTypesMap()
        Default constructor.
      • BaseTypesMap

        public BaseTypesMap​(int initialCapacity)
        Constructor that takes an initial capacity.
      • BaseTypesMap

        public BaseTypesMap​(java.util.Map<? extends K,​? extends V> m)
        Create a new base types map from the existing map.
    • Method Detail

      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface java.util.Map<K,​V>
        Overrides:
        put in class java.util.HashMap<K,​V>
      • putAll

        public void putAll​(java.util.Map<? extends K,​? extends V> m)
        Specified by:
        putAll in interface java.util.Map<K,​V>
        Overrides:
        putAll in class java.util.HashMap<K,​V>
      • checkType

        public static final void checkType​(java.lang.Object obj)
        Checks the type of obj for null or one of the valid types, otherwise throws an IllegalArgumentException.
      • clone

        public BaseTypesMap<K,​V> clone()
        Performs a deep clone of this map.
        Overrides:
        clone in class java.util.HashMap<K,​V>