Interface DatumMetadataOperations

All Superinterfaces:
Differentiable<DatumMetadataOperations>
All Known Subinterfaces:
MutableDatumMetadataOperations
All Known Implementing Classes:
GeneralDatumMetadata

public interface DatumMetadataOperations extends Differentiable<DatumMetadataOperations>
API for read-only datum metadata operations.
Since:
2.3
Version:
1.0
Author:
matt
  • Method Details

    • getInfoKeys

      default Set<String> getInfoKeys()
      Get a set of all available info keys.
      Returns:
      the set of keys, never null
    • getInfo

      Map<String,?> getInfo()
      Get a general information metadata map.
      Returns:
      the map of general information, or null
    • getInfo

      default Object getInfo(String key)
      Get the information metadata for a given key.
      Parameters:
      key - the info key to get the associated metadata value for
      Returns:
      the value, or null
    • hasInfo

      default boolean hasInfo(String key)
      Test if a given info key is available.
      Parameters:
      key - the info key to look for
      Returns:
      true if info for the given key has been set on this instance
    • getPropertyInfoKeys

      Set<String> getPropertyInfoKeys()
      Get a set of all available property info keys.
      Returns:
      the set of property info keys, never null
    • getPropertyInfo

      Map<String,?> getPropertyInfo(String key)
      Get the property information metadata map for a given key.
      Parameters:
      key - the property key to get the metadata for
      Returns:
      the property metadata, or null
    • hasPropertyInfo

      default boolean hasPropertyInfo(String key)
      Test if a given property info key is available.
      Parameters:
      key - the property info key to look for
      Returns:
      true if property info for the given key has been set on this instance
    • hasInfo

      default boolean hasInfo(String property, String key)
      Test if a given property info key is available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      true if info for the given property key has been set on this instance
    • getTags

      Set<String> getTags()
      Get the sample tags.
      Returns:
      the tags, or null
    • hasTag

      default boolean hasTag(String tag)
      Test if a given tag is set.
      Parameters:
      tag - the tag to look for
      Returns:
      true if the given tag has been set on this instance
    • isEmpty

      default boolean isEmpty()
      Test if this metadata instance has no properties set.
      Returns:
      true if there are no properties configured
    • differsFrom

      default boolean differsFrom(DatumMetadataOperations other)
      Specified by:
      differsFrom in interface Differentiable<DatumMetadataOperations>
    • hasMetadataAtPath

      default boolean hasMetadataAtPath(String path)
      Test if metadata at a given path is available.
      Parameters:
      path - the path of the metadata object to get
      Returns:
      true if metadata for the given path is available on this instance
    • metadataAtPath

      Object metadataAtPath(String path)
      Get a metadata value at a given path.
      Parameters:
      path - the path of the metadata object to get
      Returns:
      the metadata value, or null if none exists at the given path
      See Also:
    • metadataAtPath

      <T> T metadataAtPath(String path, Class<T> clazz)
      Get a metadata value of a given type at a given path.

      The path syntax is that of URL paths, using a / delimiter between nested metadata objects. The top-level path component must be one of /m for getInfo() data, /pm for getPropertyInfo(String) data, or /t for getTags() data.

      For example, the path /m/foo would return the value associated with the "foo" key in the Map returned from getInfo(). The path /pm/foo/bar would return the "bar" key in the Map associated with the "foo" key in the Map returned from getPropertyInfo(String).

      For tags, using the /t path will return the complete Set of tags returned by getTags(). If the path has another component, then the next component value will be returned if a tag matching that component value exists. For example the path /t/foo would return foo if getTags() contains foo, otherwise null.

      Type Parameters:
      T - the expected return type
      Parameters:
      path - the path of the metadata object to get
      clazz - the expected class of the return type
      Returns:
      the metadata, or null if none exists at the given path or is not of type T
    • getInfoNumber

      default Number getInfoNumber(String key)
      Get a Number value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as a Short, or null if not available
    • getInfoShort

      default Short getInfoShort(String key)
      Get a Short value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as a Short, or null if not available
    • getInfoInteger

      default Integer getInfoInteger(String key)
      Get an Integer value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as an Integer, or null if not available
    • getInfoLong

      default Long getInfoLong(String key)
      Get a Long value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as an Long, or null if not available
    • getInfoFloat

      default Float getInfoFloat(String key)
      Get a Float value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as an Float, or null if not available
    • getInfoDouble

      default Double getInfoDouble(String key)
      Get a Double value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as an Double, or null if not available
    • getInfoBigDecimal

      default BigDecimal getInfoBigDecimal(String key)
      Get a BigDecimal value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as an BigDecimal, or null if not available
    • getInfoBigInteger

      default BigInteger getInfoBigInteger(String key)
      Get a BigInteger value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as an BigInteger, or null if not available
    • getInfoString

      default String getInfoString(String key)
      Get a String value from the getInfo() map, or null if not available.
      Parameters:
      key - the key of the value to get
      Returns:
      the value as a String, or null if not available
    • getInfoNumber

      default Number getInfoNumber(String property, String key)
      Get a Number value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as a Number, or null if not available
    • getInfoShort

      default Short getInfoShort(String property, String key)
      Get a Short value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as a Short, or null if not available
    • getInfoInteger

      default Integer getInfoInteger(String property, String key)
      Get an Integer value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as an Integer, or null if not available
    • getInfoLong

      default Long getInfoLong(String property, String key)
      Get a Long value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as an Long, or null if not available
    • getInfoFloat

      default Float getInfoFloat(String property, String key)
      Get a Float value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as an Float, or null if not available
    • getInfoDouble

      default Double getInfoDouble(String property, String key)
      Get a Double value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as an Double, or null if not available
    • getInfoBigDecimal

      default BigDecimal getInfoBigDecimal(String property, String key)
      Get a BigDecimal value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as an BigDecimal, or null if not available
    • getInfoBigInteger

      default BigInteger getInfoBigInteger(String property, String key)
      Get a BigInteger value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as an BigInteger, or null if not available
    • getInfoString

      default String getInfoString(String property, String key)
      Get a String value from the getPropertyInfo(String) map, or null if not available.
      Parameters:
      property - the property name
      key - the key of the value to get
      Returns:
      the value as a String, or null if not available