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
Modifier and TypeFieldDescriptionstatic final DateTimeFormatter
static final SnowflakeIdStateParser
Fields inherited from class me.ahoo.cosid.snowflake.SnowflakeIdStateParser
DELIMITER, epoch, machineBit, machineLeft, machineMask, sequenceBit, sequenceMask, timestampBit, timestampLeft, timestampMask, zoneId
-
Constructor Summary
ConstructorDescriptionMillisecondSnowflakeIdStateParser
(long epoch, int timestampBit, int machineBit, int sequenceBit) MillisecondSnowflakeIdStateParser
(long epoch, int timestampBit, int machineBit, int sequenceBit, ZoneId zoneId) -
Method Summary
Modifier and TypeMethodDescriptionprotected DateTimeFormatter
protected long
getDiffTime
(LocalDateTime timestamp) protected LocalDateTime
getTimestamp
(long diffTime) of
(SnowflakeId snowflakeId) of
(SnowflakeId snowflakeId, ZoneId zoneId) Methods inherited from class me.ahoo.cosid.snowflake.SnowflakeIdStateParser
getZoneId, 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)
-
-
Method Details
-
getDateTimeFormatter
- Specified by:
getDateTimeFormatter
in classSnowflakeIdStateParser
-
getTimestamp
- Specified by:
getTimestamp
in classSnowflakeIdStateParser
-
getDiffTime
- Specified by:
getDiffTime
in classSnowflakeIdStateParser
-
of
-
of
-