Package me.ahoo.cosid.snowflake
Class DefaultSnowflakeFriendlyId
java.lang.Object
me.ahoo.cosid.StringIdGeneratorDecorator
me.ahoo.cosid.snowflake.StringSnowflakeId
me.ahoo.cosid.snowflake.DefaultSnowflakeFriendlyId
- All Implemented Interfaces:
Decorator<IdGenerator>,IdGenerator,IdGeneratorDecorator,SnowflakeFriendlyId,SnowflakeId,Statistical,StringIdGenerator
Default implementation of
SnowflakeFriendlyId.
Wraps a SnowflakeId and provides human-readable
string conversion using a SnowflakeIdStateParser.
-
Field Summary
Fields inherited from class me.ahoo.cosid.StringIdGeneratorDecorator
actual, idConverterFields inherited from interface me.ahoo.cosid.snowflake.SnowflakeId
TOTAL_BIT -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance with system default zone.DefaultSnowflakeFriendlyId(SnowflakeId actual, ZoneId zoneId) Creates an instance with specified zone.DefaultSnowflakeFriendlyId(SnowflakeId actual, IdConverter converter, SnowflakeIdStateParser snowflakeIdStateParser) Creates an instance with specified converter and parser.DefaultSnowflakeFriendlyId(SnowflakeId actual, SnowflakeIdStateParser snowflakeIdStateParser) Creates an instance with specified parser. -
Method Summary
Methods inherited from class me.ahoo.cosid.snowflake.StringSnowflakeId
getEpoch, getLastTimestamp, getMachineBit, getMachineId, getMaxMachineId, getMaxSequence, getMaxTimestamp, getSequenceBit, getTimestampBit, statMethods inherited from class me.ahoo.cosid.StringIdGeneratorDecorator
getActual, idConverterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.ahoo.cosid.IdGenerator
generateAsString, idConverterMethods inherited from interface me.ahoo.cosid.IdGeneratorDecorator
generateMethods inherited from interface me.ahoo.cosid.snowflake.SnowflakeFriendlyId
friendlyId, friendlyId, ofFriendlyIdMethods inherited from interface me.ahoo.cosid.snowflake.SnowflakeId
getEpoch, getLastTimestamp, getMachineBit, getMachineId, getMaxMachineId, getMaxSequence, getMaxTimestamp, getSequenceBit, getTimestampBit, isSafeJavascript, stat
-
Constructor Details
-
DefaultSnowflakeFriendlyId
Creates an instance with system default zone.- Parameters:
actual- the underlying Snowflake ID
-
DefaultSnowflakeFriendlyId
Creates an instance with specified zone.- Parameters:
actual- the underlying Snowflake IDzoneId- the time zone
-
DefaultSnowflakeFriendlyId
public DefaultSnowflakeFriendlyId(SnowflakeId actual, SnowflakeIdStateParser snowflakeIdStateParser) Creates an instance with specified parser.- Parameters:
actual- the underlying Snowflake IDsnowflakeIdStateParser- the state parser
-
DefaultSnowflakeFriendlyId
public DefaultSnowflakeFriendlyId(SnowflakeId actual, IdConverter converter, SnowflakeIdStateParser snowflakeIdStateParser) Creates an instance with specified converter and parser.- Parameters:
actual- the underlying Snowflake IDconverter- the ID convertersnowflakeIdStateParser- the state parser
-
-
Method Details
-
getParser
Description copied from interface:SnowflakeFriendlyIdGets the state parser.- Specified by:
getParserin interfaceSnowflakeFriendlyId- Returns:
- the parser
-