Iterator<String>
, Generator<String>
, IdGenerator
UniqueIdGeneratorSingleton
public class UniqueIdGeneratorImpl extends Object implements IdGenerator
UniqueIdGeneratorImpl
is an implementation of the
Generator
capable of generating ID String
instances unique on
the system on which them were generated to IDs generated with the same
UniqueIdGeneratorImpl
on another system.Constructor | Description |
---|---|
UniqueIdGeneratorImpl() |
Constructs a
UniqueIdGeneratorImpl with a default ID length of
36. |
UniqueIdGeneratorImpl(int aIdLength) |
Constructs a
UniqueIdGeneratorImpl with the provided ID length. |
Modifier and Type | Method | Description |
---|---|---|
boolean |
hasNext() |
Tests whether the
Generator is capable of generating a
Generator.next() item. |
static void |
initSeed() |
This method initializes the ID generator, it is invoked upon loading the
utility class by the class loader (static block), though it may be called
manually in case of ID collisions.
|
String |
next() |
Generates a next item.
|
void |
remove() |
forEachRemaining
public UniqueIdGeneratorImpl()
UniqueIdGeneratorImpl
with a default ID length of
36.public UniqueIdGeneratorImpl(int aIdLength)
UniqueIdGeneratorImpl
with the provided ID length.aIdLength
- The length for the generated IDs.public static void initSeed()
public boolean hasNext()
Generator
is capable of generating a
Generator.next()
item.public String next()
Copyright © 2018. All rights reserved.