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 theSequenceValueProvider
.- Author:
- Filip Hrisafov
- See Also:
SequenceValueProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SequenceGenerator
definitionId(String definitionId)
Use the definition with the given id.SequenceGenerator
definitionKey(String definitionKey)
Use the definition with the given key.SequenceGenerator
definitionTenantId(String tenantId)
Look for the definition in the given tenant.String
nextFormattedValue()
Increment the sequence number and returns its value formatted as a String based on the sequence definition model.long
nextLongValue()
Increment the sequence number and return its value as a long.
-
-
-
Method Detail
-
definitionId
SequenceGenerator definitionId(String 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
SequenceGenerator definitionKey(String 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
SequenceGenerator definitionTenantId(String tenantId)
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
-
-