|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ninja_squad.dbsetup.generator.ValueGenerators
public final class ValueGenerators
Utility class containing factory methods for ValueGenerator
Method Summary | ||
---|---|---|
static
|
constant(T constant)
Returns a value generator which always returns the same, given value. |
|
static DateSequenceValueGenerator |
dateSequence()
Returns a value generator that returns a sequence of dates, starting at a given date and incremented by a given time, specified as an increment and a calendar field. |
|
static SequenceValueGenerator |
sequence()
Returns a value generator which generates a sequence of long values starting with 1, with an increment of 1. |
|
static StringSequenceValueGenerator |
stringSequence(java.lang.String prefix)
Returns a value generator 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.). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SequenceValueGenerator sequence()
ValueGenerators.increment().startingAt(1000).incrementingBy(5)
public static <T> ValueGenerator<T> constant(@Nullable T constant)
public static StringSequenceValueGenerator stringSequence(@Nonnull java.lang.String prefix)
prefix
- the prefix before the generated number (for example: "CODE_"
).public static DateSequenceValueGenerator dateSequence()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |