Class GeneratorWrapper<S,P>
- java.lang.Object
-
- com.rapiddweller.benerator.util.AbstractGenerator<P>
-
- com.rapiddweller.benerator.wrapper.GeneratorWrapper<S,P>
-
- Type Parameters:
S
- the type parameterP
- the type parameter
- All Implemented Interfaces:
Generator<P>
,com.rapiddweller.common.Resettable
,com.rapiddweller.common.ThreadAware
,java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
AsBigDecimalGeneratorWrapper
,AsBigIntegerGeneratorWrapper
,AsByteGeneratorWrapper
,AsDoubleGeneratorWrapper
,AsFloatGeneratorWrapper
,AsIntegerGeneratorWrapper
,AsLongGeneratorWrapper
,AsShortGeneratorWrapper
,CardinalGenerator
,CompositeDatasetGenerator
,CompositeStringGenerator
,ConcatenatingGenerator
,ConvertingGenerator
,GeneratorProxy
,NonNullGeneratorWrapper
,SimpleTypeEntityGenerator
,StateTransitionGenerator
public abstract class GeneratorWrapper<S,P> extends AbstractGenerator<P>
Abstract generator class that wraps another generator object (in a source property) and delegates life cycle control to it.
Created: 12.12.2006 19:13:55- Since:
- 0.1
- Author:
- Volker Bergmann
-
-
Field Summary
-
Fields inherited from class com.rapiddweller.benerator.util.AbstractGenerator
context, logger, state
-
-
Constructor Summary
Constructors Constructor Description GeneratorWrapper(Generator<S> source)
Instantiates a new Generator wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the generator.boolean
equals(java.lang.Object other)
protected ProductWrapper<S>
generateFromSource()
Generate from source product wrapper.Generator<S>
getSource()
Returns the source generatorprotected ProductWrapper<S>
getSourceWrapper()
Gets source wrapper.int
hashCode()
void
init(GeneratorContext context)
Init.boolean
isParallelizable()
boolean
isThreadSafe()
void
reset()
void
setSource(Generator<S> source)
Sets the source generatorjava.lang.String
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
generate, getGeneratedType
-
-
-
-
Method Detail
-
setSource
public void setSource(Generator<S> source)
Sets the source generator- Parameters:
source
- the source
-
generateFromSource
protected ProductWrapper<S> generateFromSource()
Generate from source product wrapper.- Returns:
- the product wrapper
-
getSourceWrapper
protected ProductWrapper<S> getSourceWrapper()
Gets source wrapper.- Returns:
- the source wrapper
-
isThreadSafe
public boolean isThreadSafe()
-
isParallelizable
public boolean isParallelizable()
-
init
public void init(GeneratorContext context)
Description copied from interface:Generator
Init.
-
reset
public void reset()
- Specified by:
reset
in interfacecom.rapiddweller.common.Resettable
- Overrides:
reset
in classAbstractGenerator<P>
-
close
public void close()
Description copied from interface:Generator
Closes the generator. After invocation the state is unavailable.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractGenerator<P>
-
-