Package org.instancio.generator.specs
Interface InstantSpec
- All Superinterfaces:
GeneratorSpec<Instant>
,NullableGeneratorSpec<Instant>
,TemporalGeneratorSpec<Instant>
,TemporalSpec<Instant>
,TruncatableTemporalSpec<Instant>
,ValueSpec<Instant>
Spec for generating
Instant
values.- Since:
- 2.6.0
-
Method Summary
Modifier and TypeMethodDescriptionfuture()
Generate a value in the future.nullable()
Specifies that anull
value can be generatedpast()
Generate a value in the past.Generate a value within the given range.truncatedTo
(TemporalUnit unit) Truncates generated values to the specified unit.
-
Method Details
-
past
InstantSpec past()Generate a value in the past.- Specified by:
past
in interfaceTemporalGeneratorSpec<Instant>
- Specified by:
past
in interfaceTemporalSpec<Instant>
- Returns:
- spec builder
-
future
InstantSpec future()Generate a value in the future.- Specified by:
future
in interfaceTemporalGeneratorSpec<Instant>
- Specified by:
future
in interfaceTemporalSpec<Instant>
- Returns:
- spec builder
-
range
Generate a value within the given range.- Specified by:
range
in interfaceTemporalGeneratorSpec<Instant>
- Specified by:
range
in interfaceTemporalSpec<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
- Since:
- 4.2.0
-
nullable
InstantSpec nullable()Specifies that anull
value can be generated- Specified by:
nullable
in interfaceNullableGeneratorSpec<Instant>
- Specified by:
nullable
in interfaceTemporalGeneratorSpec<Instant>
- Specified by:
nullable
in interfaceTemporalSpec<Instant>
- Specified by:
nullable
in interfaceValueSpec<Instant>
- Returns:
- spec builder reference
- Since:
- 2.7.0
-