Class SimpleMetaDataMap

  • All Implemented Interfaces:
    MetaDataMap, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.Object>

    public class SimpleMetaDataMap
    extends java.util.HashMap<java.lang.String,​java.lang.Object>
    implements MetaDataMap
    A simple value map implementation, with limited conversion capabilities
    See Also:
    Serialized Form
    • Nested Class Summary

      • 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>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T get​(java.lang.String name, java.lang.Class<T> type)
      Supports automatic meta data conversion based on the given type.
      <T> T get​(java.lang.String name, T defaultValue)
      Supports automatic meta data conversion, based on the type of the default value.
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

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

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

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
    • Constructor Detail

      • SimpleMetaDataMap

        public SimpleMetaDataMap()
    • Method Detail

      • get

        public <T> T get​(java.lang.String name,
                         java.lang.Class<T> type)
        Supports automatic meta data conversion based on the given type.
        Specified by:
        get in interface MetaDataMap
        Type Parameters:
        T - the type of the class
        Parameters:
        name - The name of the meta data property
        type - The class of the type to use for conversion.
        Returns:
        The value of the property converted to type T or null if there is no such property or it cannot be converted to the given type.
        See Also:
        MetaDataMap.get(java.lang.String, java.lang.Class)
      • get

        public <T> T get​(java.lang.String name,
                         T defaultValue)
        Supports automatic meta data conversion, based on the type of the default value.
        Specified by:
        get in interface MetaDataMap
        Type Parameters:
        T - the type of the class
        Parameters:
        name - The name of the meta data property
        defaultValue - A default value to use in case the property does not exist or cannot be converted. The type to convert to is determined by the type of the default value. If the default value is null and a property for the given name exists, it is returned without conversion.
        Returns:
        The value of the property converted to type T or null if there is no such property or it cannot be converted to the given type.
        See Also:
        MetaDataMap.get(java.lang.String, java.lang.Object)