Package me.ahoo.cosid.snowflake
Class SecondSnowflakeIdStateParser
java.lang.Object
me.ahoo.cosid.snowflake.SnowflakeIdStateParser
me.ahoo.cosid.snowflake.SecondSnowflakeIdStateParser
Second SnowflakeId State Parser.
-
Field Summary
Fields inherited from class me.ahoo.cosid.snowflake.SnowflakeIdStateParser
DELIMITER, epoch, machineBit, machineLeft, machineMask, sequenceBit, sequenceMask, timestampBit, timestampLeft, timestampMask, zoneId
-
Constructor Summary
ConstructorDescriptionSecondSnowflakeIdStateParser
(long epoch, int timestampBit, int machineBit, int sequenceBit) SecondSnowflakeIdStateParser
(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) static SecondSnowflakeIdStateParser
of
(SnowflakeId snowflakeId) static SecondSnowflakeIdStateParser
of
(SnowflakeId snowflakeId, ZoneId zoneId) Methods inherited from class me.ahoo.cosid.snowflake.SnowflakeIdStateParser
getZoneId, parse, parse, parseMachineId, parseSequence, parseTimestamp
-
Field Details
-
DATE_TIME_FORMATTER
-
-
Constructor Details
-
SecondSnowflakeIdStateParser
public SecondSnowflakeIdStateParser(long epoch, int timestampBit, int machineBit, int sequenceBit) -
SecondSnowflakeIdStateParser
public SecondSnowflakeIdStateParser(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
-