Package org.instancio.internal.generator
Class InternalGeneratorHint
java.lang.Object
org.instancio.internal.generator.InternalGeneratorHint
- All Implemented Interfaces:
Hint<InternalGeneratorHint>
@InternalApi
public final class InternalGeneratorHint
extends Object
implements Hint<InternalGeneratorHint>
Internal hint related to
Generators.
This class is not part of the public API.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()booleanemitNull()Indicates whether a null value was generated byemit().booleanA hint indicating whether the generated object should be excluded fromonCompletecallbacks.booleanA hint indicating whether a generator delegates instantiation to another generator.booleanIndicates whether the value to generate is nullable.Class<?>A hint indicating the type of object to generate.toString()
-
Method Details
-
targetClass
A hint indicating the type of object to generate.Some generators may request a specific type to generate. For example, collection generators may accept types via
subtype()method.- Returns:
- target class
- Since:
- 2.0.0
-
isDelegating
public boolean isDelegating()A hint indicating whether a generator delegates instantiation to another generator. This occurs when the generator does not have enough information to determine which type to instantiate.- Returns:
truea generator is delegating,falseotherwise- Since:
- 2.0.0
-
excludeFromCallbacks
public boolean excludeFromCallbacks()A hint indicating whether the generated object should be excluded fromonCompletecallbacks.- Returns:
trueif callbacks should not be invoked on generated object- Since:
- 2.0.0
-
nullableResult
public boolean nullableResult()Indicates whether the value to generate is nullable.- Returns:
trueif null is allowed to be generated- Since:
- 2.0.0
-
emitNull
public boolean emitNull()Indicates whether a null value was generated byemit(). This tells the engine to permit the null value to be added to a collection/map, which normally requiresCollectionHint.nullableElements()(and similarly forMapHint) to be set.- Returns:
trueif null was generated byemit()- Since:
- 2.12.0
-
toString
-
builder
-