Class MonthDayGenerator
java.lang.Object
org.instancio.internal.generator.AbstractGenerator<MonthDay>
org.instancio.internal.generator.time.MonthDayGenerator
- All Implemented Interfaces:
AsStringGeneratorSpec<MonthDay>
,Generator<MonthDay>
,GeneratorSpec<MonthDay>
,AsGeneratorSpec<MonthDay>
,MonthDayGeneratorSpec
,NullableGeneratorSpec<MonthDay>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the public API method name of the generator spec.Generate aMonthDay
value on or before the specified day.Generate aMonthDay
value on or after the specified day.Generate aMonthDay
value between the given range.protected MonthDay
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, nullable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asString
Methods inherited from interface org.instancio.generator.AsStringGeneratorSpec
asString
-
Constructor Details
-
MonthDayGenerator
-
-
Method Details
-
apiMethod
Description copied from class:AbstractGenerator
Returns the public API method name of the generator spec. The returned name is used for reporting validation errors.- Specified by:
apiMethod
in classAbstractGenerator<MonthDay>
- Returns:
- spec name if defined, or
null
otherwise
-
min
Description copied from interface:MonthDayGeneratorSpec
Generate aMonthDay
value on or after the specified day.- Specified by:
min
in interfaceMonthDayGeneratorSpec
- Parameters:
min
- lower bound- Returns:
- spec builder
-
max
Description copied from interface:MonthDayGeneratorSpec
Generate aMonthDay
value on or before the specified day.- Specified by:
max
in interfaceMonthDayGeneratorSpec
- Parameters:
max
- upper bound- Returns:
- spec builder
-
range
Description copied from interface:MonthDayGeneratorSpec
Generate aMonthDay
value between the given range.- Specified by:
range
in interfaceMonthDayGeneratorSpec
- Parameters:
min
- lower bound (inclusive)max
- upper bound (inclusive)- Returns:
- spec builder
-
tryGenerateNonNull
Description copied from class:AbstractGenerator
Makes the best effort to return a non-null value. However, in certain cases this method will produce anull
.- Specified by:
tryGenerateNonNull
in classAbstractGenerator<MonthDay>
- Parameters:
random
- for generating the value- Returns:
- generated value, either a null or non-null
-