Package org.instancio.generator.specs
Interface NumericSequenceAsGeneratorSpec<T extends Number & Comparable<T>>
- Type Parameters:
T
- the number type
- All Superinterfaces:
AsGeneratorSpec<T>
,GeneratorSpec<T>
,NullableGeneratorSpec<T>
,NumericSequenceGeneratorSpec<T>
@ExperimentalApi
public interface NumericSequenceAsGeneratorSpec<T extends Number & Comparable<T>>
extends NumericSequenceGeneratorSpec<T>, AsGeneratorSpec<T>
A spec for generating numeric sequences
that supports
AsGeneratorSpec
.- Since:
- 2.13.0
-
Method Summary
Modifier and TypeMethodDescriptionnext
(UnaryOperator<T> next) Specifies the function for calculating the next sequence value.nullable()
Indicates thatnull
value can be generated.Specifies the starting value of the sequence.Methods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asString
-
Method Details
-
start
Description copied from interface:NumericSequenceGeneratorSpec
Specifies the starting value of the sequence. The default is1
.- Specified by:
start
in interfaceNumericSequenceGeneratorSpec<T extends Number & Comparable<T>>
- Parameters:
start
- the initial value of the sequence- Returns:
- spec builder
-
next
Description copied from interface:NumericSequenceGeneratorSpec
Specifies the function for calculating the next sequence value. If unspecified, the default is to increment the sequence by1
.- Specified by:
next
in interfaceNumericSequenceGeneratorSpec<T extends Number & Comparable<T>>
- Parameters:
next
- a function for calculating the next value- Returns:
- spec builder
-
nullable
NumericSequenceAsGeneratorSpec<T> nullable()Description copied from interface:NumericSequenceGeneratorSpec
Indicates thatnull
value can be generated.- Specified by:
nullable
in interfaceNullableGeneratorSpec<T extends Number & Comparable<T>>
- Specified by:
nullable
in interfaceNumericSequenceGeneratorSpec<T extends Number & Comparable<T>>
- Returns:
- spec builder
-