Record Class SnowflakeIdParser.ParsedId
java.lang.Object
java.lang.Record
cloud.opencode.base.id.snowflake.SnowflakeIdParser.ParsedId
- Record Components:
id- the original ID | 原始IDtimestamp- the timestamp in milliseconds | 时间戳(毫秒)time- the timestamp as Instant | 时间戳(Instant)datacenterId- the datacenter ID | 数据中心IDworkerId- the worker ID | 工作节点IDsequence- the sequence number | 序列号
- Enclosing class:
SnowflakeIdParser
public static record SnowflakeIdParser.ParsedId(long id, long timestamp, Instant time, long datacenterId, long workerId, long sequence)
extends Record
Parsed Snowflake ID Result
解析的雪花ID结果
- Since:
- JDK 25, opencode-base-id V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thedatacenterIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longid()Returns the value of theidrecord component.longsequence()Returns the value of thesequencerecord component.time()Returns the value of thetimerecord component.longReturns the value of thetimestamprecord component.toString()Returns a string representation of this record class.longworkerId()Returns the value of theworkerIdrecord component.
-
Constructor Details
-
ParsedId
public ParsedId(long id, long timestamp, Instant time, long datacenterId, long workerId, long sequence) Creates an instance of aParsedIdrecord class.- Parameters:
id- the value for theidrecord componenttimestamp- the value for thetimestamprecord componenttime- the value for thetimerecord componentdatacenterId- the value for thedatacenterIdrecord componentworkerId- the value for theworkerIdrecord componentsequence- the value for thesequencerecord component
-
-
Method Details
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
timestamp
-
time
-
datacenterId
public long datacenterId()Returns the value of thedatacenterIdrecord component.- Returns:
- the value of the
datacenterIdrecord component
-
workerId
-
sequence
-