Package net.solarnetwork.central.domain
Class AggregateDatumId
java.lang.Object
net.solarnetwork.domain.BaseId
net.solarnetwork.central.domain.AggregateDatumId
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<AggregateDatumId>
public class AggregateDatumId
extends net.solarnetwork.domain.BaseId
implements Cloneable, Serializable, Comparable<AggregateDatumId>
A general aggregate datum identifier.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAggregateDatumId(net.solarnetwork.domain.datum.ObjectDatumKind kind, Long objectId, String sourceId, Instant timestamp, net.solarnetwork.domain.datum.Aggregation aggregation) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()intbooleannet.solarnetwork.domain.datum.AggregationGet the aggregation.net.solarnetwork.domain.datum.ObjectDatumKindgetKind()Get the kind.Get the object ID.Get the source ID.Get the timestamp.inthashCode()booleanisValidAggregateObjectId(net.solarnetwork.domain.datum.ObjectDatumKind expectedKind) Test if this object ID is fully specified as an aggregate.booleanisValidObjectId(net.solarnetwork.domain.datum.ObjectDatumKind expectedKind) Test if this object ID is fully specified.static AggregateDatumIdlocationId(Long locationId, String sourceId, Instant timestamp, net.solarnetwork.domain.datum.Aggregation aggregation) Create a new location datum stream ID.static AggregateDatumIdnodeId(Long nodeId, String sourceId, Instant timestamp, net.solarnetwork.domain.datum.Aggregation aggregation) Create a new node aggregate datum ID.protected voidprotected voidMethods inherited from class net.solarnetwork.domain.BaseId
getId, toString
-
Constructor Details
-
AggregateDatumId
public AggregateDatumId(net.solarnetwork.domain.datum.ObjectDatumKind kind, Long objectId, String sourceId, Instant timestamp, net.solarnetwork.domain.datum.Aggregation aggregation) Constructor.- Parameters:
kind- the kindobjectId- the stream object IDsourceId- ID the stream source IDtimestamp- the time stampaggregation- the aggregation
-
-
Method Details
-
nodeId
public static AggregateDatumId nodeId(Long nodeId, String sourceId, Instant timestamp, net.solarnetwork.domain.datum.Aggregation aggregation) Create a new node aggregate datum ID.- Parameters:
nodeId- the node IDsourceId- the source IDtimestamp- the timestampaggregation- the aggregation- Returns:
- the new instance
-
locationId
public static AggregateDatumId locationId(Long locationId, String sourceId, Instant timestamp, net.solarnetwork.domain.datum.Aggregation aggregation) Create a new location datum stream ID.- Parameters:
locationId- the node IDsourceId- the source IDtimestamp- the timestampaggregation- the aggregation- Returns:
- the new instance
-
clone
- Overrides:
clonein classnet.solarnetwork.domain.BaseId
-
populateIdValue
- Specified by:
populateIdValuein classnet.solarnetwork.domain.BaseId
-
populateStringValue
- Specified by:
populateStringValuein classnet.solarnetwork.domain.BaseId
-
compareTo
- Specified by:
compareToin interfaceComparable<AggregateDatumId>
-
hashCode
public int hashCode() -
equals
-
isValidObjectId
public boolean isValidObjectId(net.solarnetwork.domain.datum.ObjectDatumKind expectedKind) Test if this object ID is fully specified.- Parameters:
expectedKind- the kind to match- Returns:
- true if
expectedKindis the same as this object'skindandobjectId,sourceId,timestampare all non-null and non-empty
-
isValidAggregateObjectId
public boolean isValidAggregateObjectId(net.solarnetwork.domain.datum.ObjectDatumKind expectedKind) Test if this object ID is fully specified as an aggregate.- Parameters:
expectedKind- the kind to match- Returns:
- true if
isValidObjectId(ObjectDatumKind)returns true andaggregationis non-null - See Also:
-
getKind
public net.solarnetwork.domain.datum.ObjectDatumKind 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
-
getAggregation
public net.solarnetwork.domain.datum.Aggregation getAggregation()Get the aggregation.- Returns:
- the aggregation
-