Class BasicDatumStreamMetadata

java.lang.Object
net.solarnetwork.domain.datum.BasicDatumStreamMetadata
All Implemented Interfaces:
Serializable, DatumStreamMetadata
Direct Known Subclasses:
BasicObjectDatumStreamMetadata

public class BasicDatumStreamMetadata extends Object implements DatumStreamMetadata, Serializable
Implementation of DatumStreamMetadata.
Since:
1.72
Version:
2.0
Author:
matt
See Also:
  • Constructor Details

    • BasicDatumStreamMetadata

      public BasicDatumStreamMetadata(UUID streamId, String timeZoneId, String[] instantaneousProperties, String[] accumulatingProperties, String[] statusProperties)
      Constructor.

      All arguments except streamId are allowed to be null. If any array is empty, it will be treated as if it were null.

      Parameters:
      streamId - the stream ID
      timeZoneId - the time zone ID
      instantaneousProperties - the instantaneous property names
      accumulatingProperties - the accumulating property names
      statusProperties - the status property names
      Throws:
      IllegalArgumentException - if streamId is null
    • BasicDatumStreamMetadata

      public BasicDatumStreamMetadata(UUID streamId, String timeZoneId, Object instantaneousProperties, Object accumulatingProperties, Object statusProperties)
      Constructor.

      All arguments except streamId are allowed to be null. The other arguments are Object to work around MyBatis mapping issues. If any array is empty, it will be treated as if it were null.

      Parameters:
      streamId - the stream ID
      timeZoneId - the time zone ID
      instantaneousProperties - the instantaneous property names; must be a String[]
      accumulatingProperties - the accumulating property names; must be a String[]
      statusProperties - the status property names; must be a String[]
      Throws:
      IllegalArgumentException - if streamId is null
  • Method Details

    • getStreamId

      public UUID getStreamId()
      Description copied from interface: DatumStreamMetadata
      Get the stream ID.
      Specified by:
      getStreamId in interface DatumStreamMetadata
      Returns:
      the stream ID
    • getTimeZoneId

      public String getTimeZoneId()
      Description copied from interface: DatumStreamMetadata
      Get the time zone ID associated with this stream.
      Specified by:
      getTimeZoneId in interface DatumStreamMetadata
      Returns:
      the time zone ID, or null if not known
    • getPropertyNamesLength

      public int getPropertyNamesLength()
      Get the total number of instantaneous, accumulating, and status property names.
      Returns:
      the total number of properties
    • getPropertyNames

      public String[] getPropertyNames()
      Description copied from interface: DatumStreamMetadata
      Get all property names included in the stream.
      Specified by:
      getPropertyNames in interface DatumStreamMetadata
      Returns:
      the property names
    • propertyNamesForType

      public String[] propertyNamesForType(DatumSamplesType type)
      Description copied from interface: DatumStreamMetadata
      Get the subset of all property names that are of a specific type.
      Specified by:
      propertyNamesForType in interface DatumStreamMetadata
      Parameters:
      type - the type of property to get the names for
      Returns:
      the property names, or null if none available or type is DatumSamplesType.Tag
    • getInstantaneousLength

      public int getInstantaneousLength()
      Get the instantaneous property names array length.
      Returns:
      the number of instantaneous property names
    • getAccumulatingLength

      public int getAccumulatingLength()
      Get the accumulating property names array length.
      Returns:
      the number of accumulating property names
    • getStatusLength

      public int getStatusLength()
      Get the status property names array length.
      Returns:
      the number of status property names
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object