|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ninja_squad.dbsetup.generator.StringSequenceValueGenerator
public final class StringSequenceValueGenerator
A ValueGenerator that returns a string prefix followed by a sequence number, optionally left-padded
with 0 to ensure a correct ordering (for example: CODE_001, CODE_002, etc.). Instances of this generator
are created by ValueGenerators.stringSequence(String).
| Method Summary | |
|---|---|
StringSequenceValueGenerator |
incrementingBy(int increment)
Increments the number by the given increment. |
java.lang.String |
nextValue()
Called each time a new row is inserted, to get the value to insert in the column using this value generator. |
StringSequenceValueGenerator |
startingAt(long start)
Restarts the sequence at the given value |
java.lang.String |
toString()
|
StringSequenceValueGenerator |
withLeftPadding(int paddedNumberLength)
Tells the generator to left-pad the number it generates with 0 until the length of the number is the given length. |
StringSequenceValueGenerator |
withoutLeftPadding()
Tells the generator to avoid left-padding the number it generates with 0 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public StringSequenceValueGenerator withLeftPadding(int paddedNumberLength)
paddedNumberLength - the length of the number once padded. Must be > 0.
public StringSequenceValueGenerator withoutLeftPadding()
public StringSequenceValueGenerator startingAt(long start)
start - the new starting value of the sequence
public StringSequenceValueGenerator incrementingBy(int increment)
public java.lang.String nextValue()
ValueGenerator
nextValue in interface ValueGenerator<java.lang.String>public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||