Package org.instancio.generator.specs
Interface InstantGeneratorAsSpec
- All Superinterfaces:
AsGeneratorSpec<Instant>,GeneratorSpec<Instant>,NullableGeneratorSpec<Instant>,TemporalAsGeneratorSpec<Instant>,TemporalGeneratorSpec<Instant>,TruncatableTemporalSpec<Instant>
public interface InstantGeneratorAsSpec
extends TemporalAsGeneratorSpec<Instant>, TruncatableTemporalSpec<Instant>
Generator spec for
Instant.- Since:
- 4.2.0
-
Method Summary
Modifier and TypeMethodDescriptionfuture()Generate a value in the future.nullable()Indicates thatnullvalue can be generated.past()Generate a value in the past.Generate a value within the given range.truncatedTo(TemporalUnit unit) Truncates generated values to the specified unit.Methods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asString
-
Method Details
-
past
InstantGeneratorAsSpec past()Generate a value in the past.- Specified by:
pastin interfaceTemporalAsGeneratorSpec<Instant>- Specified by:
pastin interfaceTemporalGeneratorSpec<Instant>- Returns:
- spec builder
-
future
InstantGeneratorAsSpec future()Generate a value in the future.- Specified by:
futurein interfaceTemporalAsGeneratorSpec<Instant>- Specified by:
futurein interfaceTemporalGeneratorSpec<Instant>- Returns:
- spec builder
-
range
Generate a value within the given range.- Specified by:
rangein interfaceTemporalAsGeneratorSpec<Instant>- Specified by:
rangein interfaceTemporalGeneratorSpec<Instant>- Parameters:
start- lower bound (inclusive)end- upper bound (inclusive)- Returns:
- spec builder
-
truncatedTo
Truncates generated values to the specified unit.- Specified by:
truncatedToin interfaceTruncatableTemporalSpec<Instant>- Parameters:
unit- to truncate to- Returns:
- spec builder
-
nullable
InstantGeneratorAsSpec nullable()Indicates thatnullvalue can be generated.- Specified by:
nullablein interfaceNullableGeneratorSpec<Instant>- Specified by:
nullablein interfaceTemporalGeneratorSpec<Instant>- Returns:
- spec builder
-