Package me.ahoo.cosid.snowflake
Class MillisecondSnowflakeIdStateParser
java.lang.Object
me.ahoo.cosid.snowflake.SnowflakeIdStateParser
me.ahoo.cosid.snowflake.MillisecondSnowflakeIdStateParser
Millisecond SnowflakeId State Parser.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DateTimeFormatterstatic final SnowflakeIdStateParserFields inherited from class me.ahoo.cosid.snowflake.SnowflakeIdStateParser
DELIMITER, epoch, machineBit, machineLeft, machineMask, padStart, sequenceBit, sequenceMask, timestampBit, timestampLeft, timestampMask, zoneId -
Constructor Summary
ConstructorsConstructorDescriptionMillisecondSnowflakeIdStateParser(long epoch, int timestampBit, int machineBit, int sequenceBit) MillisecondSnowflakeIdStateParser(long epoch, int timestampBit, int machineBit, int sequenceBit, ZoneId zoneId, boolean padStart) -
Method Summary
Modifier and TypeMethodDescriptionprotected DateTimeFormatterprotected longgetDiffTime(LocalDateTime timestamp) protected LocalDateTimegetTimestamp(long diffTime) of(SnowflakeId snowflakeId) of(SnowflakeId snowflakeId, ZoneId zoneId) of(SnowflakeId snowflakeId, ZoneId zoneId, boolean padStart) Methods inherited from class me.ahoo.cosid.snowflake.SnowflakeIdStateParser
getMachineCharSize, getSequenceCharSize, getZoneId, isPadStart, parse, parse, parseMachineId, parseSequence, parseTimestamp
-
Field Details
-
INSTANCE
-
DATE_TIME_FORMATTER
-
-
Constructor Details
-
MillisecondSnowflakeIdStateParser
public MillisecondSnowflakeIdStateParser(long epoch, int timestampBit, int machineBit, int sequenceBit) -
MillisecondSnowflakeIdStateParser
public MillisecondSnowflakeIdStateParser(long epoch, int timestampBit, int machineBit, int sequenceBit, ZoneId zoneId, boolean padStart)
-
-
Method Details
-
getDateTimeFormatter
- Specified by:
getDateTimeFormatterin classSnowflakeIdStateParser
-
getTimestamp
- Specified by:
getTimestampin classSnowflakeIdStateParser
-
getDiffTime
- Specified by:
getDiffTimein classSnowflakeIdStateParser
-
of
-
of
-
of
public static MillisecondSnowflakeIdStateParser of(SnowflakeId snowflakeId, ZoneId zoneId, boolean padStart)
-