Package org.instancio.generator.specs
Interface NumericSequenceGeneratorSpec<T extends Number & Comparable<T>>
- Type Parameters:
T- the number type
- All Superinterfaces:
AsGeneratorSpec<T>,GeneratorSpec<T>,NullableGeneratorSpec<T>
- All Known Subinterfaces:
NumericSequenceSpec<T>
@ExperimentalApi
public interface NumericSequenceGeneratorSpec<T extends Number & Comparable<T>>
extends AsGeneratorSpec<T>, NullableGeneratorSpec<T>
A 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()Indicates thatnullvalue can be generated.Specifies the starting value of the sequence.Methods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asString
-
Method Details
-
start
Specifies the starting value of the sequence. The default is1.- Parameters:
start- the initial value of the sequence- Returns:
- spec builder
- Since:
- 2.13.0
-
next
Specifies the function for calculating the next sequence value. If unspecified, the default is to increment the sequence by1.- Parameters:
next- a function for calculating the next value- Returns:
- spec builder
- Since:
- 2.13.0
-
nullable
NumericSequenceGeneratorSpec<T> nullable()Indicates thatnullvalue can be generated.- Specified by:
nullablein interfaceNullableGeneratorSpec<T extends Number & Comparable<T>>- Returns:
- spec builder
- Since:
- 2.13.0
-