Class DatumId

java.lang.Object
net.solarnetwork.domain.BaseId
net.solarnetwork.domain.datum.DatumId
All Implemented Interfaces:
Serializable, Cloneable, Comparable<DatumId>

public class DatumId extends BaseId implements Serializable, Cloneable, Comparable<DatumId>
Primary key for a datum based on kind/object/source/timestamp values.
Since:
1.71
Version:
2.0
Author:
matt
See Also:
  • Constructor Details

    • DatumId

      public DatumId(ObjectDatumKind kind, Long objectId, String sourceId, Instant timestamp)
      Constructor.
      Parameters:
      kind - the kind
      objectId - the stream object ID
      sourceId - ID the stream source ID
      timestamp - the time stamp
  • Method Details

    • nodeId

      public static DatumId nodeId(Long nodeId, String sourceId, Instant timestamp)
      Create a new node datum stream ID.
      Parameters:
      nodeId - the node ID
      sourceId - the source ID
      timestamp - the timestamp
      Returns:
      the key
    • locationId

      public static DatumId locationId(Long locationId, String sourceId, Instant timestamp)
      Create a new location datum stream ID.
      Parameters:
      locationId - the node ID
      sourceId - the source ID
      timestamp - the timestamp
      Returns:
      the key
    • clone

      public DatumId clone()
      Overrides:
      clone in class BaseId
    • populateIdValue

      protected void populateIdValue(StringBuilder buf)
      Description copied from class: BaseId
      Populate a string builder with an ID value.

      This method is called from BaseId.getId().

      Specified by:
      populateIdValue in class BaseId
      Parameters:
      buf - the buffer to populate
    • populateStringValue

      protected void populateStringValue(StringBuilder buf)
      Description copied from class: BaseId
      Populate a string builder with a friendly string value.

      This method is called from BaseId.toString(). The buffer will be initially empty when invoked.

      Specified by:
      populateStringValue in class BaseId
      Parameters:
      buf - the buffer to populate
    • compareTo

      public int compareTo(DatumId o)
      Specified by:
      compareTo in interface Comparable<DatumId>
    • hashCode

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

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

      public ObjectDatumKind getKind()
      Get the kind.
      Returns:
      the kind
    • getObjectId

      public Long getObjectId()
      Get the object ID.
      Returns:
      the object ID
    • getSourceId

      public String getSourceId()
      Get the source ID.
      Returns:
      the source ID
    • getTimestamp

      public Instant getTimestamp()
      Get the timestamp.
      Returns:
      the timestamp