Package org.instancio.generator.specs
Interface InstantSpec
- All Superinterfaces:
AsGeneratorSpec<Instant>,GeneratorSpec<Instant>,InstantGeneratorSpec,NullableGeneratorSpec<Instant>,Supplier<Instant>,TemporalGeneratorSpec<Instant>,TemporalSpec<Instant>,TruncatableTemporalGeneratorSpec<Instant>,ValueSpec<Instant>
public interface InstantSpec
extends TemporalSpec<Instant>, InstantGeneratorSpec, TruncatableTemporalGeneratorSpec<Instant>
Spec for generating
Instant values.- Since:
- 2.6.0
-
Method Summary
Modifier and TypeMethodDescriptionfuture()Generate a value in the future.Specifies the upper bound.Specifies the lower bound.nullable()Specifies that anullvalue 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.Methods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asString
-
Method Details
-
past
Generate a value in the past.- Specified by:
pastin interfaceInstantGeneratorSpec- Specified by:
pastin interfaceTemporalGeneratorSpec<Instant>- Specified by:
pastin interfaceTemporalSpec<Instant>- Returns:
- spec builder
-
future
Generate a value in the future.- Specified by:
futurein interfaceInstantGeneratorSpec- Specified by:
futurein interfaceTemporalGeneratorSpec<Instant>- Specified by:
futurein interfaceTemporalSpec<Instant>- Returns:
- spec builder
-
min
Specifies the lower bound.- Specified by:
minin interfaceInstantGeneratorSpec- Specified by:
minin interfaceTemporalGeneratorSpec<Instant>- Specified by:
minin interfaceTemporalSpec<Instant>- Parameters:
min- lower bound (inclusive)- Returns:
- spec builder
- Since:
- 4.6.0
- See Also:
-
max
Specifies the upper bound.- Specified by:
maxin interfaceInstantGeneratorSpec- Specified by:
maxin interfaceTemporalGeneratorSpec<Instant>- Specified by:
maxin interfaceTemporalSpec<Instant>- Parameters:
max- upper bound (inclusive)- Returns:
- spec builder
- Since:
- 4.6.0
- See Also:
-
range
Generate a value within the given range.- Specified by:
rangein interfaceInstantGeneratorSpec- Specified by:
rangein interfaceTemporalGeneratorSpec<Instant>- Specified by:
rangein interfaceTemporalSpec<Instant>- Parameters:
min- lower bound (inclusive)max- upper bound (inclusive)- Returns:
- spec builder
- See Also:
-
truncatedTo
Truncates generated values to the specified unit.- Specified by:
truncatedToin interfaceInstantGeneratorSpec- Specified by:
truncatedToin interfaceTruncatableTemporalGeneratorSpec<Instant>- Parameters:
unit- to truncate to- Returns:
- spec builder
- Since:
- 4.2.0
-
nullable
InstantSpec nullable()Specifies that anullvalue can be generated- Specified by:
nullablein interfaceInstantGeneratorSpec- Specified by:
nullablein interfaceNullableGeneratorSpec<Instant>- Specified by:
nullablein interfaceTemporalGeneratorSpec<Instant>- Specified by:
nullablein interfaceTemporalSpec<Instant>- Specified by:
nullablein interfaceValueSpec<Instant>- Returns:
- spec builder reference
- Since:
- 2.7.0
-