Interface SnowflakeId

All Superinterfaces:
IdGenerator, Statistical, StringIdGenerator
All Known Subinterfaces:
SnowflakeFriendlyId
All Known Implementing Classes:
AbstractSnowflakeId, ClockSyncSnowflakeId, DefaultSnowflakeFriendlyId, MillisecondSnowflakeId, SecondSnowflakeId, StringSnowflakeId

public interface SnowflakeId extends IdGenerator
Snowflake algorithm ID generator.

SnowflakeId

  • Field Details

  • Method Details

    • getEpoch

      long getEpoch()
    • getTimestampBit

      int getTimestampBit()
    • getMachineBit

      int getMachineBit()
    • getSequenceBit

      int getSequenceBit()
    • isSafeJavascript

      default boolean isSafeJavascript()
      是否是 Javascript 安全的 SnowflakeId. SafeJavaScriptSnowflakeId.JAVA_SCRIPT_MAX_SAFE_NUMBER_BIT.
      Returns:
      Is it a JavaScript secure snowflakeId
    • getMaxTimestamp

      long getMaxTimestamp()
    • getMaxMachineId

      int getMaxMachineId()
    • getMaxSequence

      long getMaxSequence()
    • getLastTimestamp

      long getLastTimestamp()
    • getMachineId

      int getMachineId()
    • defaultSequenceResetThreshold

      static long defaultSequenceResetThreshold(int sequenceBit)
    • stat

      default IdGeneratorStat stat()
      Specified by:
      stat in interface IdGenerator
      Specified by:
      stat in interface Statistical