Package org.instancio.generator.specs
Interface LocalDateTimeSpec
- All Superinterfaces:
GeneratorSpec<LocalDateTime>,NullableGeneratorSpec<LocalDateTime>,TemporalGeneratorSpec<LocalDateTime>,TemporalSpec<LocalDateTime>,TruncatableTemporalSpec<LocalDateTime>,ValueSpec<LocalDateTime>
public interface LocalDateTimeSpec
extends TemporalSpec<LocalDateTime>, TruncatableTemporalSpec<LocalDateTime>
Spec for generating
LocalDateTime values.- Since:
- 2.6.0
-
Method Summary
Modifier and TypeMethodDescriptionfuture()Generate a value in the future.nullable()Specifies that anullvalue can be generatedpast()Generate a value in the past.range(LocalDateTime start, LocalDateTime end) Generate a value within the given range.truncatedTo(TemporalUnit unit) Truncates generated values to the specified unit.
-
Method Details
-
past
LocalDateTimeSpec past()Generate a value in the past.- Specified by:
pastin interfaceTemporalGeneratorSpec<LocalDateTime>- Specified by:
pastin interfaceTemporalSpec<LocalDateTime>- Returns:
- spec builder
-
future
LocalDateTimeSpec future()Generate a value in the future.- Specified by:
futurein interfaceTemporalGeneratorSpec<LocalDateTime>- Specified by:
futurein interfaceTemporalSpec<LocalDateTime>- Returns:
- spec builder
-
range
Generate a value within the given range.- Specified by:
rangein interfaceTemporalGeneratorSpec<LocalDateTime>- Specified by:
rangein interfaceTemporalSpec<LocalDateTime>- Parameters:
start- lower bound (inclusive)end- upper bound (inclusive)- Returns:
- spec builder
-
truncatedTo
Truncates generated values to the specified unit.- Specified by:
truncatedToin interfaceTruncatableTemporalSpec<LocalDateTime>- Parameters:
unit- to truncate to- Returns:
- spec builder
- Since:
- 4.2.0
-
nullable
LocalDateTimeSpec nullable()Specifies that anullvalue can be generated- Specified by:
nullablein interfaceNullableGeneratorSpec<LocalDateTime>- Specified by:
nullablein interfaceTemporalGeneratorSpec<LocalDateTime>- Specified by:
nullablein interfaceTemporalSpec<LocalDateTime>- Specified by:
nullablein interfaceValueSpec<LocalDateTime>- Returns:
- spec builder reference
- Since:
- 2.7.0
-