Class UlidParser.ParsedUlid

java.lang.Object
cloud.opencode.base.id.ulid.UlidParser.ParsedUlid
Enclosing class:
UlidParser

public static final class UlidParser.ParsedUlid extends Object
Parsed ULID Result 解析的ULID结果
Since:
JDK 25, opencode-base-id V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • ParsedUlid

      public ParsedUlid(String ulid, long timestamp, Instant time, byte[] randomness)
      Creates a parsed ULID result 创建解析的ULID结果
      Parameters:
      ulid - the original ULID | 原始ULID
      timestamp - the timestamp in milliseconds | 时间戳(毫秒)
      time - the timestamp as Instant | 时间戳(Instant)
      randomness - the randomness bytes | 随机性字节
  • Method Details

    • ulid

      public String ulid()
      Gets the original ULID 获取原始ULID
      Returns:
      ULID string | ULID字符串
    • timestamp

      public long timestamp()
      Gets the timestamp 获取时间戳
      Returns:
      timestamp in milliseconds | 时间戳(毫秒)
    • time

      public Instant time()
      Gets the time 获取时间
      Returns:
      time as Instant | 时间(Instant)
    • randomness

      public byte[] randomness()
      Gets the randomness bytes 获取随机性字节
      Returns:
      randomness bytes (copy) | 随机性字节(副本)
    • getTimestampPart

      public String getTimestampPart()
      Gets the timestamp part (first 10 characters) 获取时间戳部分(前10个字符)
      Returns:
      timestamp part | 时间戳部分
    • getRandomnessPart

      public String getRandomnessPart()
      Gets the randomness part (last 16 characters) 获取随机性部分(后16个字符)
      Returns:
      randomness part | 随机性部分
    • toString

      public String toString()
      Overrides:
      toString in class Object