Class NonNullGeneratorWrapper<S,P>
- java.lang.Object
-
- com.rapiddweller.benerator.util.AbstractGenerator<P>
-
- com.rapiddweller.benerator.wrapper.GeneratorWrapper<S,P>
-
- com.rapiddweller.benerator.wrapper.NonNullGeneratorWrapper<S,P>
-
- Type Parameters:
S
- the type parameterP
- the type parameter
- All Implemented Interfaces:
Generator<P>
,NonNullGenerator<P>
,com.rapiddweller.common.Resettable
,com.rapiddweller.common.ThreadAware
,java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
DateGenerator
,EAN13Generator
,EAN8Generator
,FileContentGenerator
,FileNameGenerator
,SeedSentenceGenerator
,SeedWordGenerator
,UniqueFixedLengthStringGenerator
public abstract class NonNullGeneratorWrapper<S,P> extends GeneratorWrapper<S,P> implements NonNullGenerator<P>
- Since:
- 0.7.0
- Author:
- Volker Bergmann
-
-
Field Summary
-
Fields inherited from class com.rapiddweller.benerator.util.AbstractGenerator
context, logger, state
-
-
Constructor Summary
Constructors Constructor Description NonNullGeneratorWrapper(NonNullGenerator<S> source)
Instantiates a new Non null generator wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProductWrapper<P>
generate(ProductWrapper<P> wrapper)
Returns an instance of the generic type E, using theProductWrapper
instance provided as argument.protected S
generateFromNotNullSource()
Generate from not null source s.NonNullGenerator<S>
getSource()
Returns the source generatorvoid
setSource(NonNullGenerator<S> source)
Sets the source generator-
Methods inherited from class com.rapiddweller.benerator.wrapper.GeneratorWrapper
close, equals, generateFromSource, getSourceWrapper, hashCode, init, isParallelizable, isThreadSafe, reset, setSource, toString
-
Methods inherited from class com.rapiddweller.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, wasInitialized
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.rapiddweller.benerator.Generator
close, getGeneratedType, init, wasInitialized
-
Methods inherited from interface com.rapiddweller.benerator.NonNullGenerator
generate
-
-
-
-
Constructor Detail
-
NonNullGeneratorWrapper
public NonNullGeneratorWrapper(NonNullGenerator<S> source)
Instantiates a new Non null generator wrapper.- Parameters:
source
- the source
-
-
Method Detail
-
getSource
public NonNullGenerator<S> getSource()
Returns the source generator- Overrides:
getSource
in classGeneratorWrapper<S,P>
- Returns:
- the source
-
setSource
public void setSource(NonNullGenerator<S> source)
Sets the source generator- Parameters:
source
- the source
-
generateFromNotNullSource
protected final S generateFromNotNullSource()
Generate from not null source s.- Returns:
- the s
-
generate
public final ProductWrapper<P> generate(ProductWrapper<P> wrapper)
Description copied from interface:Generator
Returns an instance of the generic type E, using theProductWrapper
instance provided as argument. The wrapper may wrap a null value as a regular generator product. If the generator is not available (any more), it returns null instead of the ProductWrapper instance.
-
-