java.lang.Object
java.lang.Record
me.ahoo.cosid.time.IdParts
- Record Components:
time- the time, in units of the layout since its epochnode- the node, the machine slotseq- the sequence
The parts of a time-based id (03-core-model.md ยง2).
-
Constructor Summary
ConstructorsConstructorDescriptionIdParts(long time, int node, long seq) Creates an instance of aIdPartsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.The instant oftime().intnode()Returns the value of thenoderecord component.longseq()Returns the value of theseqrecord component.longtime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
instant
The instant oftime().- Parameters:
layout- the layout the parts come from- Returns:
- the instant
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
time
public long time()Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-
node
public int node()Returns the value of thenoderecord component.- Returns:
- the value of the
noderecord component
-
seq
public long seq()Returns the value of theseqrecord component.- Returns:
- the value of the
seqrecord component
-