Package me.ahoo.cosid.sharding
Class SnowflakeLocalDateTimeConvertor
java.lang.Object
me.ahoo.cosid.sharding.SnowflakeLocalDateTimeConvertor
- All Implemented Interfaces:
LocalDateTimeConvertor
Converts a Snowflake id, a
Long or its text, to the time it was issued: Layout.unpack(long) gives the
time part (D7; 4.x used a SnowflakeIdStateParser).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final me.ahoo.cosid.codec.IdCodecThe text form of 4.x'sRadix62IdConverter.PAD_START: base 62, 11 digits, padded. -
Constructor Summary
ConstructorsConstructorDescriptionSnowflakeLocalDateTimeConvertor(me.ahoo.cosid.time.Layout layout, ZoneId zoneId) Creates the convertor; text values are base 62, 11 digits, padded.SnowflakeLocalDateTimeConvertor(me.ahoo.cosid.time.Layout layout, ZoneId zoneId, me.ahoo.cosid.codec.IdCodec codec) Creates the convertor. -
Method Summary
-
Field Details
-
RADIX62_PAD_START
public static final me.ahoo.cosid.codec.IdCodec RADIX62_PAD_STARTThe text form of 4.x'sRadix62IdConverter.PAD_START: base 62, 11 digits, padded.
-
-
Constructor Details
-
SnowflakeLocalDateTimeConvertor
Creates the convertor; text values are base 62, 11 digits, padded.- Parameters:
layout- the layout of the idszoneId- the zone of the local date-time
-
SnowflakeLocalDateTimeConvertor
public SnowflakeLocalDateTimeConvertor(me.ahoo.cosid.time.Layout layout, ZoneId zoneId, me.ahoo.cosid.codec.IdCodec codec) Creates the convertor.- Parameters:
layout- the layout of the idszoneId- the zone of the local date-timecodec- decodes text values
-
-
Method Details
-
toLocalDateTime
Description copied from interface:LocalDateTimeConvertorTo local date time.- Specified by:
toLocalDateTimein interfaceLocalDateTimeConvertor- Parameters:
value- value to be converted- Returns:
- converted local date time
-