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 thatnull
value 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:
past
in interfaceTemporalAsGeneratorSpec<Instant>
- Specified by:
past
in interfaceTemporalGeneratorSpec<Instant>
- Returns:
- spec builder
-
future
InstantGeneratorAsSpec future()Generate a value in the future.- Specified by:
future
in interfaceTemporalAsGeneratorSpec<Instant>
- Specified by:
future
in interfaceTemporalGeneratorSpec<Instant>
- Returns:
- spec builder
-
range
Generate a value within the given range.- Specified by:
range
in interfaceTemporalAsGeneratorSpec<Instant>
- Specified by:
range
in interfaceTemporalGeneratorSpec<Instant>
- Parameters:
start
- lower bound (inclusive)end
- upper bound (inclusive)- Returns:
- spec builder
-
truncatedTo
Truncates generated values to the specified unit.- Specified by:
truncatedTo
in interfaceTruncatableTemporalSpec<Instant>
- Parameters:
unit
- to truncate to- Returns:
- spec builder
-
nullable
InstantGeneratorAsSpec nullable()Indicates thatnull
value can be generated.- Specified by:
nullable
in interfaceNullableGeneratorSpec<Instant>
- Specified by:
nullable
in interfaceTemporalGeneratorSpec<Instant>
- Returns:
- spec builder
-