Package me.ahoo.cosid.provider
Class LazyIdGenerator
java.lang.Object
me.ahoo.cosid.provider.LazyIdGenerator
- All Implemented Interfaces:
Decorator<IdGenerator>,IdGenerator,IdGeneratorDecorator,Statistical,StringIdGenerator
Lazy loading IdGenerator.
-
Constructor Summary
ConstructorsConstructorDescriptionLazyIdGenerator(String generatorName) LazyIdGenerator(String generatorName, IdGeneratorProvider idGeneratorProvider) -
Method Summary
Modifier and TypeMethodDescriptionasFriendlyId(boolean required) asSegmentId(boolean required) asSnowflakeId(boolean required) Get the actual (wrapped) ID generator that this decorator is enhancing.Get the ID converter used to convertlongtype IDs toString.tryGet(boolean required) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.ahoo.cosid.IdGenerator
generateAsStringMethods inherited from interface me.ahoo.cosid.IdGeneratorDecorator
generate, stat
-
Constructor Details
-
LazyIdGenerator
-
LazyIdGenerator
-
-
Method Details
-
getGeneratorName
-
tryGet
-
asSnowflakeId
-
asFriendlyId
-
asSegmentId
-
getActual
Description copied from interface:IdGeneratorDecoratorGet the actual (wrapped) ID generator that this decorator is enhancing.This method returns the underlying ID generator that this decorator is wrapping. All ID generation requests are typically delegated to this actual generator, with the decorator adding its additional functionality.
- Specified by:
getActualin interfaceDecorator<IdGenerator>- Specified by:
getActualin interfaceIdGeneratorDecorator- Returns:
- The actual ID generator being decorated
-
idConverter
Description copied from interface:IdGeneratorGet the ID converter used to convertlongtype IDs toString.By default, this returns
Radix62IdConverter.PAD_STARTwhich converts long IDs to radix-62 string representations with padding to ensure consistent string lengths.- Specified by:
idConverterin interfaceIdGenerator- Returns:
- ID converter for transforming numeric IDs to string format
-