Record Class TtsIdPlus
java.lang.Object
java.lang.Record
uno.xifan.id.generator.distributed.ttsid.TtsIdPlus
- All Implemented Interfaces:
Id
-
Constructor Summary
ConstructorsConstructorDescriptionTtsIdPlus(long timestamp, int threadId, short sequence) Creates an instance of aTtsIdPlusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic longfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.shortsequence()Returns the value of thesequencerecord component.intthreadId()Returns the value of thethreadIdrecord component.longReturns the value of thetimestamprecord component.toBase16()toBase32()专门为80bit优化的算法byte[]toBytes()longtoLong()final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface uno.xifan.id.base.Id
long2bytes, longToBytes, toBase10, toBase36, toBase62, toBase64
-
Constructor Details
-
TtsIdPlus
public TtsIdPlus(long timestamp, int threadId, short sequence) Creates an instance of aTtsIdPlusrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentthreadId- the value for thethreadIdrecord componentsequence- the value for thesequencerecord component
-
-
Method Details
-
currentTimestamp
public static long currentTimestamp() -
toBytes
public byte[] toBytes() -
toLong
public long toLong() -
toBase32
专门为80bit优化的算法 -
toBase16
-
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 '=='. -
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
threadId
public int threadId()Returns the value of thethreadIdrecord component.- Returns:
- the value of the
threadIdrecord component
-
sequence
public short sequence()Returns the value of thesequencerecord component.- Returns:
- the value of the
sequencerecord component
-