Class UlidParser.ParsedUlid
java.lang.Object
cloud.opencode.base.id.ulid.UlidParser.ParsedUlid
- Enclosing class:
UlidParser
Parsed ULID Result
解析的ULID结果
- Since:
- JDK 25, opencode-base-id V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionParsedUlid(String ulid, long timestamp, Instant time, byte[] randomness) Creates a parsed ULID result 创建解析的ULID结果 -
Method Summary
Modifier and TypeMethodDescriptionGets the randomness part (last 16 characters) 获取随机性部分(后16个字符)Gets the timestamp part (first 10 characters) 获取时间戳部分(前10个字符)byte[]Gets the randomness bytes 获取随机性字节time()Gets the time 获取时间longGets the timestamp 获取时间戳toString()ulid()Gets the original ULID 获取原始ULID
-
Constructor Details
-
ParsedUlid
Creates a parsed ULID result 创建解析的ULID结果- Parameters:
ulid- the original ULID | 原始ULIDtimestamp- the timestamp in milliseconds | 时间戳(毫秒)time- the timestamp as Instant | 时间戳(Instant)randomness- the randomness bytes | 随机性字节
-
-
Method Details
-
ulid
-
timestamp
public long timestamp()Gets the timestamp 获取时间戳- Returns:
- timestamp in milliseconds | 时间戳(毫秒)
-
time
-
randomness
public byte[] randomness()Gets the randomness bytes 获取随机性字节- Returns:
- randomness bytes (copy) | 随机性字节(副本)
-
getTimestampPart
Gets the timestamp part (first 10 characters) 获取时间戳部分(前10个字符)- Returns:
- timestamp part | 时间戳部分
-
getRandomnessPart
Gets the randomness part (last 16 characters) 获取随机性部分(后16个字符)- Returns:
- randomness part | 随机性部分
-
toString
-