Package net.tangly.commons.generator
Class LongIdGenerator
java.lang.Object
net.tangly.commons.generator.LongIdGenerator
- All Implemented Interfaces:
IdGenerator
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
LongIdGenerator
public LongIdGenerator(long initialValue)
-
-
Method Details
-
id
public long id()Description copied from interface:IdGenerator
new identifier for the application usage.- Specified by:
id
in interfaceIdGenerator
- Returns:
- new unique identifier
-
set
public void set(long externalId) Description copied from interface:IdGenerator
Sets the generator based on a new external identifier.- Specified by:
set
in interfaceIdGenerator
- Parameters:
externalId
- new external identifier.
-