Class SimpleMetaDataMap

java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
com.adobe.granite.workflow.metadata.SimpleMetaDataMap
All Implemented Interfaces:
MetaDataMap, Serializable, Cloneable, Map<String,Object>

public class SimpleMetaDataMap extends HashMap<String,Object> implements MetaDataMap
A simple value map implementation, with limited conversion capabilities
See Also:
  • Constructor Details

    • SimpleMetaDataMap

      public SimpleMetaDataMap()
  • Method Details

    • get

      public <T> T get(String name, 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:
    • get

      public <T> T get(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: