Interface DatumSamplesOperations

All Superinterfaces:
Differentiable<DatumSamplesOperations>
All Known Subinterfaces:
MutableDatumSamplesOperations
All Known Implementing Classes:
DatumSamples, GeneralDatum, MapSampleOperations

public interface DatumSamplesOperations extends Differentiable<DatumSamplesOperations>
API for accessing general datum sample property values.
Since:
2.0
Version:
1.0
Author:
matt
  • Method Details

    • getSampleData

      Map<String,?> getSampleData(DatumSamplesType type)
      Get specific sample data.
      Parameters:
      type - the type of sample data to get
      Returns:
      a map with the specific sample data, or null
      Throws:
      IllegalArgumentException - if type is not supported
    • getSampleInteger

      Integer getSampleInteger(DatumSamplesType type, String key)
      Get an Integer value from a sample map, or null if not available.
      Parameters:
      type - the type of sample data to get
      key - the key of the value to get
      Returns:
      the value as an Integer, or null if not available
    • getSampleLong

      Long getSampleLong(DatumSamplesType type, String key)
      Get a Long value from a sample map, or null if not available.
      Parameters:
      type - the type of sample data to get
      key - the key of the value to get
      Returns:
      the value as an Long, or null if not available
    • getSampleFloat

      Float getSampleFloat(DatumSamplesType type, String key)
      Get a Float value from a sample map, or null if not available.
      Parameters:
      type - the type of sample data to get
      key - the key of the value to get
      Returns:
      the value as an Float, or null if not available
    • getSampleDouble

      Double getSampleDouble(DatumSamplesType type, String key)
      Get a Double value from a sample map, or null if not available.
      Parameters:
      type - the type of sample data to get
      key - the key of the value to get
      Returns:
      the value as an Double, or null if not available
    • getSampleBigDecimal

      BigDecimal getSampleBigDecimal(DatumSamplesType type, String key)
      Get a BigDecimal value from a sample map, or null if not available.
      Parameters:
      type - the type of sample data to get
      key - the key of the value to get
      Returns:
      the value as an BigDecimal, or null if not available
    • getSampleString

      String getSampleString(DatumSamplesType type, String key)
      Get a String value from a sample map, or null if not available.

      If type is DatumSamplesType.Tag, then this method will return key if a tag by that name exists and otherwise it will return null.

      Parameters:
      type - the type of sample data to get
      key - the key of the value, or tag name, to get
      Returns:
      the value as an String, or null if not available
    • getSampleValue

      <V> V getSampleValue(DatumSamplesType type, String key)
      Get a sample value.

      If type is DatumSamplesType.Tag, then this method will return key if a tag by that name exists and otherwise it will return null.

      Type Parameters:
      V - the expected value type
      Parameters:
      type - the type of sample data to get
      key - the key of the value, or tag name, to get
      Returns:
      the value cast as a V, or null if not available
    • hasSampleValue

      boolean hasSampleValue(DatumSamplesType type, String key)
      Test is a sample value is present for a given key.

      Tags can be tested for as well by passing DatumSamplesType.Tag and the tag name as key.

      Parameters:
      type - the type of sample data to test
      key - the key of the value, or name of the tag, to look for
      Returns:
      true if a value is present for the given key
    • findSampleValue

      <V> V findSampleValue(String key)
      Find a sample value.

      This will search Instantaneous, Accumulating, and Status data types, in that order, and return the first non-null value found.

      Type Parameters:
      V - the expected value type
      Parameters:
      key - the key of the value, or tag name, to get
      Returns:
      the value cast as a V, or null if not available
    • hasSampleValue

      boolean hasSampleValue(String key)
      Test is a sample value is present for a given key.

      This will search Instantaneous, Accumulating, and Status data types, in that order, and return the first non-null value found.

      Parameters:
      key - the key of the value, or name of the tag, to look for
      Returns:
      true if a value is present for the given key
    • 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 there are any properties available.
      Returns:
      true if there is at least one non-null property or tag available
    • differsFrom

      default boolean differsFrom(DatumSamplesOperations other)
      Description copied from interface: Differentiable
      Test if this object differs from another.
      Specified by:
      differsFrom in interface Differentiable<DatumSamplesOperations>
      Parameters:
      other - the other object to compare to
      Returns:
      true if the object differs from this object