Class SqlDateGenerator
java.lang.Object
org.instancio.internal.generator.AbstractGenerator<Date>
org.instancio.internal.generator.sql.SqlDateGenerator
- All Implemented Interfaces:
Generator<Date>,GeneratorSpec<Date>,NullableGeneratorSpec<Date>,TemporalGeneratorSpec<Date>
public class SqlDateGenerator
extends AbstractGenerator<Date>
implements TemporalGeneratorSpec<Date>
-
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
-
SqlDateGenerator
-
-
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<Date>- Returns:
- spec name if defined, or
nullotherwise
-
past
Description copied from interface:TemporalGeneratorSpecGenerate a value in the past.- Specified by:
pastin interfaceTemporalGeneratorSpec<Date>- Returns:
- spec builder
-
future
Description copied from interface:TemporalGeneratorSpecGenerate a value in the future.- Specified by:
futurein interfaceTemporalGeneratorSpec<Date>- Returns:
- spec builder
-
range
Description copied from interface:TemporalGeneratorSpecGenerate a value within the given range.- Specified by:
rangein interfaceTemporalGeneratorSpec<Date>- 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<Date>- Specified by:
nullablein interfaceTemporalGeneratorSpec<Date>- Overrides:
nullablein classAbstractGenerator<Date>- 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<Date>- Parameters:
random- for generating the value- Returns:
- generated value, either a null or non-null
-