Record Class KsuidParser.ParsedKsuid
java.lang.Object
java.lang.Record
cloud.opencode.base.id.ksuid.KsuidParser.ParsedKsuid
- Record Components:
ksuid- the original KSUID string | 原始KSUID字符串bytes- the raw 20-byte representation | 原始20字节表示time- the timestamp | 时间戳payload- the 16-byte random payload | 16字节随机负载
- Enclosing class:
KsuidParser
public static record KsuidParser.ParsedKsuid(String ksuid, byte[] bytes, Instant time, byte[] payload)
extends Record
Parsed KSUID result
解析后的KSUID结果
- Since:
- JDK 25, opencode-base-id V1.1.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionParsedKsuid(String ksuid, byte[] bytes, Instant time, byte[] payload) Compact canonical constructor that makes defensive copies of mutable byte arrays to prevent callers from mutating internal state. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()Returns a defensive copy of the raw bytes 返回原始字节的防御性副本final booleanIndicates whether some other object is "equal to" this one.Gets the payload as hex string 获取负载的十六进制字符串Gets the timestamp part as hex string 获取时间戳部分的十六进制字符串final inthashCode()Returns a hash code value for this object.ksuid()Returns the value of theksuidrecord component.byte[]payload()Returns a defensive copy of the payload 返回负载的防御性副本time()Returns the value of thetimerecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
ParsedKsuid
-
-
Method Details
-
bytes
public byte[] bytes()Returns a defensive copy of the raw bytes 返回原始字节的防御性副本- Returns:
- copy of bytes | 字节副本
-
payload
public byte[] payload()Returns a defensive copy of the payload 返回负载的防御性副本- Returns:
- copy of payload | 负载副本
-
getTimestampHex
Gets the timestamp part as hex string 获取时间戳部分的十六进制字符串- Returns:
- hex string | 十六进制字符串
-
getPayloadHex
Gets the payload as hex string 获取负载的十六进制字符串- Returns:
- hex string | 十六进制字符串
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
ksuid
-
time
-