@groovy.transform.Trait trait CodeSequenceTrait extends java.lang.Object
Defines the code sequence numbering policy for generating an object code (primary key fields) on the shop floor. These are typically used for Orders and LSNs. This trait provides the common logic for most sequences. Each concrete implementation of the sequence (e.g. LSNSequence) will need some fields defined:
Type | Name and description |
---|---|
long |
currentSequence |
java.lang.String |
formatString |
java.lang.String |
sequence |
java.lang.String |
title |
Constructor and description |
---|
CodeSequenceTrait
() |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
formatTest(java.util.Map params) Format the current number for test/display purposes. |
|
java.util.List<java.lang.String> |
formatValues(int nValues, java.util.Map params) Format one or more values using the current sequence. |
|
java.util.List<java.lang.String> |
formatValuesInternal(int nValues, java.util.Map params) Private internal format method. |
|
long |
getCurrentSequence() |
|
boolean |
getDefaultSequence() |
|
java.lang.String |
getFormatString() |
|
java.lang.String |
getSequence() |
|
java.lang.String |
getTitle() |
|
void |
setCurrentSequence(long currentSequence) |
|
void |
setDefaultSequence(boolean defaultSequence) |
|
void |
setFormatString(java.lang.String formatString) |
|
void |
setSequence(java.lang.String sequence) |
|
void |
setTitle(java.lang.String title) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Format the current number for test/display purposes. Does not increment the current sequence or other properties.
params
- Optional list of parameters to be used in the formatting.Format one or more values using the current sequence. Updates the current sequence as needed.
Note: For locking reasons, this method discards the original Sequence instance, so the caller should not rely on it.nValues
- The number of new numbers to generate.params
- Optional list of parameters to be used in the formatting.Private internal format method. Used to work around record locking issues.
Note: Not to be called by client code under any circumstances.nValues
- The number of new numbers to generate.params
- Optional list of parameters to be used in the formatting.