Package me.ahoo.cosid
Class IntegerIdGenerator
java.lang.Object
me.ahoo.cosid.IntegerIdGenerator
- All Implemented Interfaces:
StringIdGenerator
Integer Id Generator.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ID Overflow Exception. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
generate()
Generate distributed ID of type int.Generate distributed ID of type string.
-
Field Details
-
actual
-
-
Constructor Details
-
IntegerIdGenerator
-
-
Method Details
-
generate
Generate distributed ID of type int.- Returns:
- generated distributed ID of type int
- Throws:
IntegerIdGenerator.IdOverflowException
- This exception is thrown when the ID overflows
-
generateAsString
Generate distributed ID of type string.- Specified by:
generateAsString
in interfaceStringIdGenerator
- Returns:
- generated distributed ID of type string
- Throws:
IntegerIdGenerator.IdOverflowException
- This exception is thrown when the ID overflows
-