Interface SequenceGenerator
- All Known Implementing Classes:
SequenceGeneratorImpl
public interface SequenceGenerator
This is the sequence generator used which uses the Sequence Definitions to configure itself and perform the formatting for the generated sequence.
The sequence incrementation is done by the
SequenceValueProvider
.- Author:
- Filip Hrisafov
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefinitionId
(String definitionId) Use the definition with the given id.definitionKey
(String definitionKey) Use the definition with the given key.definitionTenantId
(String tenantId) Look for the definition in the given tenant.Increment the sequence number and returns its value formatted as a String based on the sequence definition model.long
Increment the sequence number and return its value as a long.
-
Method Details
-
definitionId
Use the definition with the given id. Not allowed to be used in combination withdefinitionKey(String)
- Parameters:
definitionId
- the id of the sequence definition
-
definitionKey
Use the definition with the given key. Not allowed to be used in combination withdefinitionId(String)
- Parameters:
definitionKey
- the key of the sequence definition
-
definitionTenantId
Look for the definition in the given tenant. Only applicable in combination withdefinitionKey(String)
- Parameters:
tenantId
- the tenant id of the sequence definition
-
nextLongValue
long nextLongValue()Increment the sequence number and return its value as a long.- Returns:
- the next value as a long
-
nextFormattedValue
String nextFormattedValue()Increment the sequence number and returns its value formatted as a String based on the sequence definition model.- Returns:
- the next value formatted as a String
-