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
FieldsFields inherited from class me.ahoo.cosid.snowflake.SnowflakeIdStateParser
DELIMITER, epoch, machineBit, machineLeft, machineMask, padStart, sequenceBit, sequenceMask, timestampBit, timestampLeft, timestampMask, zoneId -
Constructor Summary
ConstructorsConstructorDescriptionSecondSnowflakeIdStateParser(long epoch, int timestampBit, int machineBit, int sequenceBit) SecondSnowflakeIdStateParser(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) static SecondSnowflakeIdStateParserof(SnowflakeId snowflakeId) static SecondSnowflakeIdStateParserof(SnowflakeId snowflakeId, ZoneId zoneId) static SecondSnowflakeIdStateParserof(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
-
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, boolean padStart)
-
-
Method Details
-
getDateTimeFormatter
- Specified by:
getDateTimeFormatterin classSnowflakeIdStateParser
-
getTimestamp
- Specified by:
getTimestampin classSnowflakeIdStateParser
-
getDiffTime
- Specified by:
getDiffTimein classSnowflakeIdStateParser
-
of
-
of
-
of
public static SecondSnowflakeIdStateParser of(SnowflakeId snowflakeId, ZoneId zoneId, boolean padStart)
-