Class LoremIpsumGenerator
java.lang.Object
org.instancio.internal.generator.AbstractGenerator<String>
org.instancio.internal.generator.text.LoremIpsumGenerator
- All Implemented Interfaces:
Generator<String>,GeneratorSpec<String>,LoremIpsumGeneratorSpec,LoremIpsumSpec,NullableGeneratorSpec<String>,ValueSpec<String>
-
Field Summary
Fields inherited from interface org.instancio.generator.specs.LoremIpsumGeneratorSpec
DEFAULT_PARAGRAPHS, DEFAULT_WORDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the public API method name of the generator spec.nullable()Indicates thatnullvalue can be generated.paragraphs(int paragraphs) Number of paragraphs to generate.protected StringtryGenerateNonNull(Random random) Makes the best effort to return a non-null value.words(int words) Number of words to generate.Methods inherited from class org.instancio.internal.generator.AbstractGenerator
generate, getContext, hints, isNullable, nullable
-
Constructor Details
-
LoremIpsumGenerator
public LoremIpsumGenerator() -
LoremIpsumGenerator
-
-
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<String>- Returns:
- spec name if defined, or
nullotherwise
-
words
Description copied from interface:LoremIpsumGeneratorSpecNumber of words to generate. Default isLoremIpsumGeneratorSpec.DEFAULT_WORDS.- Specified by:
wordsin interfaceLoremIpsumGeneratorSpec- Specified by:
wordsin interfaceLoremIpsumSpec- Returns:
- spec builder
-
paragraphs
Description copied from interface:LoremIpsumGeneratorSpecNumber of paragraphs to generate. Default isLoremIpsumGeneratorSpec.DEFAULT_PARAGRAPHS.- Specified by:
paragraphsin interfaceLoremIpsumGeneratorSpec- Specified by:
paragraphsin interfaceLoremIpsumSpec- Returns:
- spec builder
-
nullable
Description copied from interface:NullableGeneratorSpecIndicates thatnullvalue can be generated.- Specified by:
nullablein interfaceLoremIpsumSpec- Specified by:
nullablein interfaceNullableGeneratorSpec<String>- Specified by:
nullablein interfaceValueSpec<String>- Overrides:
nullablein classAbstractGenerator<String>- 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<String>- Parameters:
random- for generating the value- Returns:
- generated value, either a null or non-null
-