Class TimestampGenerator
java.lang.Object
org.instancio.internal.generator.AbstractGenerator<Timestamp>
org.instancio.internal.generator.sql.TimestampGenerator
- All Implemented Interfaces:
Generator<Timestamp>,GeneratorSpec<Timestamp>,NullableGeneratorSpec<Timestamp>,TemporalGeneratorSpec<Timestamp>
public class TimestampGenerator
extends AbstractGenerator<Timestamp>
implements TemporalGeneratorSpec<Timestamp>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the public API method name of the generator spec.future()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.tryGenerateNonNull(Random random) Makes the best effort to return a non-null value.Methods inherited from class org.instancio.internal.generator.AbstractGenerator
generate, getContext, hints, isNullable, nullable
-
Constructor Details
-
TimestampGenerator
-
-
Method Details
-
apiMethod
Description copied from class:AbstractGeneratorReturns the public API method name of the generator spec. The returned name is used for reporting validation errors.- Specified by:
apiMethodin classAbstractGenerator<Timestamp>- Returns:
- spec name if defined, or
nullotherwise
-
past
Description copied from interface:TemporalGeneratorSpecGenerate a value in the past.- Specified by:
pastin interfaceTemporalGeneratorSpec<Timestamp>- Returns:
- spec builder
-
future
Description copied from interface:TemporalGeneratorSpecGenerate a value in the future.- Specified by:
futurein interfaceTemporalGeneratorSpec<Timestamp>- Returns:
- spec builder
-
range
Description copied from interface:TemporalGeneratorSpecGenerate a value within the given range.- Specified by:
rangein interfaceTemporalGeneratorSpec<Timestamp>- Parameters:
start- lower bound (inclusive)end- upper bound (inclusive)- Returns:
- spec builder
-
nullable
Description copied from interface:NullableGeneratorSpecIndicates thatnullvalue can be generated.- Specified by:
nullablein interfaceNullableGeneratorSpec<Timestamp>- Specified by:
nullablein interfaceTemporalGeneratorSpec<Timestamp>- Overrides:
nullablein classAbstractGenerator<Timestamp>- Returns:
- spec builder
-
tryGenerateNonNull
Description copied from class:AbstractGeneratorMakes the best effort to return a non-null value. However, in certain cases this method will produce anull.- Specified by:
tryGenerateNonNullin classAbstractGenerator<Timestamp>- Parameters:
random- for generating the value- Returns:
- generated value, either a null or non-null
-