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 DateTimeFormatter
static final SnowflakeIdStateParser
Fields 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 DateTimeFormatter
protected long
getDiffTime
(LocalDateTime timestamp) protected LocalDateTime
getTimestamp
(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:
getDateTimeFormatter
in classSnowflakeIdStateParser
-
getTimestamp
- Specified by:
getTimestamp
in classSnowflakeIdStateParser
-
getDiffTime
- Specified by:
getDiffTime
in classSnowflakeIdStateParser
-
of
-
of
-
of
public static MillisecondSnowflakeIdStateParser of(SnowflakeId snowflakeId, ZoneId zoneId, boolean padStart)
-