Package org.uncommons.util.id
Interface IDSource<T extends Serializable>
-
- Type Parameters:
T
- The type of ID returned by this source.
- All Known Implementing Classes:
CompositeIDSource
,IntSequenceIDSource
,LongSequenceIDSource
,StringPrefixIDSource
public interface IDSource<T extends Serializable>
Defines operations for classes that generate unique identifiers. Generated IDs must be of aSerializable
type. The strategy used will vary between implementations. It may be a straightforward sequence or a more complex, less predictable algorithm.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
nextID()
Implementing classes are responsible for synchronization if concurrent invocations of this method are required.
-
-
-
Method Detail
-
nextID
T nextID()
Implementing classes are responsible for synchronization if concurrent invocations of this method are required.- Returns:
- The next ID.
- Throws:
IDSourceExhaustedException
- If this ID source cannot generate any more unique IDs.
-
-