Package me.ahoo.cosid.snowflake
Interface SnowflakeId
- All Superinterfaces:
IdGenerator
,Statistical
,StringIdGenerator
- All Known Subinterfaces:
SnowflakeFriendlyId
- All Known Implementing Classes:
AbstractSnowflakeId
,ClockSyncSnowflakeId
,DefaultSnowflakeFriendlyId
,MillisecondSnowflakeId
,SecondSnowflakeId
,StringSnowflakeId
Snowflake algorithm ID generator.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
defaultSequenceResetThreshold
(int sequenceBit) long
getEpoch()
long
int
int
int
long
long
int
int
default boolean
是否是 Javascript 安全的 SnowflakeId.default IdGeneratorStat
stat()
Methods inherited from interface me.ahoo.cosid.IdGenerator
generate, generateAsString, idConverter
-
Field Details
-
TOTAL_BIT
static final int TOTAL_BIT- See Also:
-
-
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
- Specified by:
stat
in interfaceIdGenerator
- Specified by:
stat
in interfaceStatistical
-