org.databene.benerator.sample
Class ConstantGenerator<E>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<E>
      extended by org.databene.benerator.util.ThreadSafeGenerator<E>
          extended by org.databene.benerator.sample.ConstantGenerator<E>
All Implemented Interfaces:
java.io.Closeable, Generator<E>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class ConstantGenerator<E>
extends ThreadSafeGenerator<E>

Generator implementation that always returns the same value.

Created: 08.06.2006 20:26:22

Since:
0.1
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
ConstantGenerator()
           
ConstantGenerator(E value)
          Initializes the generator to generate the specified value
ConstantGenerator(E value, java.lang.Class<E> generatedType)
           
 
Method Summary
 ProductWrapper<E> generate(ProductWrapper<E> wrapper)
          Returns the value of property 'value'
 java.lang.Class<E> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 E getValue()
          Returns the property 'value'
 void setValue(E value)
          Sets the property 'value'
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.util.ThreadSafeGenerator
isParallelizable, isThreadSafe
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, close, getResultWrapper, init, reset, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantGenerator

public ConstantGenerator()

ConstantGenerator

public ConstantGenerator(E value)
Initializes the generator to generate the specified value


ConstantGenerator

public ConstantGenerator(E value,
                         java.lang.Class<E> generatedType)
Method Detail

getValue

public E getValue()
Returns the property 'value'


setValue

public void setValue(E value)
Sets the property 'value'


getGeneratedType

public java.lang.Class<E> getGeneratedType()
Description copied from interface: Generator
Declares the type of the objects returned by the generate() method.


generate

public ProductWrapper<E> generate(ProductWrapper<E> wrapper)
Returns the value of property 'value'


toString

public java.lang.String toString()
Overrides:
toString in class AbstractGenerator<E>


Copyright © 2013. All Rights Reserved.