Package net.solarnetwork.domain.datum
Class DatumId
java.lang.Object
net.solarnetwork.domain.BaseId
net.solarnetwork.domain.datum.DatumId
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionDatumId(ObjectDatumKind kind, Long objectId, String sourceId, Instant timestamp) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()intbooleangetKind()Get the kind.Get the object ID.Get the source ID.Get the timestamp.inthashCode()static DatumIdlocationId(Long locationId, String sourceId, Instant timestamp) Create a new location datum stream ID.static DatumIdCreate a new node datum stream ID.protected voidPopulate a string builder with an ID value.protected voidPopulate a string builder with a friendly string value.
-
Constructor Details
-
DatumId
Constructor.- Parameters:
kind- the kindobjectId- the stream object IDsourceId- ID the stream source IDtimestamp- the time stamp
-
-
Method Details
-
nodeId
Create a new node datum stream ID.- Parameters:
nodeId- the node IDsourceId- the source IDtimestamp- the timestamp- Returns:
- the key
-
locationId
Create a new location datum stream ID.- Parameters:
locationId- the node IDsourceId- the source IDtimestamp- the timestamp- Returns:
- the key
-
clone
-
populateIdValue
Description copied from class:BaseIdPopulate a string builder with an ID value.This method is called from
BaseId.getId().- Specified by:
populateIdValuein classBaseId- Parameters:
buf- the buffer to populate
-
populateStringValue
Description copied from class:BaseIdPopulate 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:
populateStringValuein classBaseId- Parameters:
buf- the buffer to populate
-
compareTo
- Specified by:
compareToin interfaceComparable<DatumId>
-
hashCode
public int hashCode() -
equals
-
getKind
Get the kind.- Returns:
- the kind
-
getObjectId
Get the object ID.- Returns:
- the object ID
-
getSourceId
Get the source ID.- Returns:
- the source ID
-
getTimestamp
Get the timestamp.- Returns:
- the timestamp
-