Package org.instancio.generator.specs
Interface NumericSequenceSpec<T extends Number & Comparable<T>>
- Type Parameters:
T- the number type
- All Superinterfaces:
GeneratorSpec<T>,NullableGeneratorSpec<T>,NumericSequenceGeneratorSpec<T>,ValueSpec<T>
@ExperimentalApi
public interface NumericSequenceSpec<T extends Number & Comparable<T>>
extends ValueSpec<T>, NumericSequenceGeneratorSpec<T>
Spec for generating numeric sequences.
- Since:
- 2.13.0
-
Method Summary
Modifier and TypeMethodDescriptionnext(UnaryOperator<T> next) Specifies the function for calculating the next sequence value.nullable()Specifies that anullvalue can be generatedSpecifies the starting value of the sequence.
-
Method Details
-
start
Description copied from interface:NumericSequenceGeneratorSpecSpecifies the starting value of the sequence. The default is1.- Specified by:
startin interfaceNumericSequenceGeneratorSpec<T extends Number & Comparable<T>>- Parameters:
start- the initial value of the sequence- Returns:
- spec builder
-
next
Description copied from interface:NumericSequenceGeneratorSpecSpecifies the function for calculating the next sequence value. If unspecified, the default is to increment the sequence by1.- Specified by:
nextin interfaceNumericSequenceGeneratorSpec<T extends Number & Comparable<T>>- Parameters:
next- a function for calculating the next value- Returns:
- spec builder
-
nullable
NumericSequenceSpec<T> nullable()Description copied from interface:ValueSpecSpecifies that anullvalue can be generated- Specified by:
nullablein interfaceNullableGeneratorSpec<T extends Number & Comparable<T>>- Specified by:
nullablein interfaceNumericSequenceGeneratorSpec<T extends Number & Comparable<T>>- Specified by:
nullablein interfaceValueSpec<T extends Number & Comparable<T>>- Returns:
- spec builder reference
-