Package org.instancio.generator.specs
Interface IntervalSpec<T>
- Type Parameters:
T- the type of value that defines the interval
- All Superinterfaces:
GeneratorSpec<IntervalSupplier<T>>,Supplier<IntervalSupplier<T>>,ValueSpec<IntervalSupplier<T>>
Spec for generating intervals of various types,
such as numeric and temporal values.
- Since:
- 5.0.0
-
Method Summary
Modifier and TypeMethodDescriptionnextEnd(RandomUnaryOperator<T> nextEndFn) Specifies the function for calculating theendvalue of the interval based on thestartvalue of the current interval.nextStart(RandomUnaryOperator<T> nextStartFn) Specifies the function for calculating thestartvalue of the next interval based on theendvalue of the current interval.nullable()Specifies that anullvalue can be generated
-
Method Details
-
nextStart
Specifies the function for calculating thestartvalue of the next interval based on theendvalue of the current interval.- Parameters:
nextStartFn- function for calculating the starting value of the next interval- Returns:
- API builder reference
- Since:
- 5.0.0
-
nextEnd
Specifies the function for calculating theendvalue of the interval based on thestartvalue of the current interval.- Parameters:
nextEndFn- function for calculating theendvalue of the interval- Returns:
- API builder reference
- Since:
- 5.0.0
-
nullable
IntervalSpec<T> nullable()Specifies that anullvalue can be generated
-