org.databene.benerator.primitive
Class EquivalenceStringGenerator<E>
java.lang.Object
org.databene.benerator.util.AbstractGenerator<P>
org.databene.benerator.wrapper.GeneratorWrapper<S,P>
org.databene.benerator.wrapper.CardinalGenerator<E,java.lang.String>
org.databene.benerator.primitive.EquivalenceStringGenerator<E>
- All Implemented Interfaces:
- java.io.Closeable, Generator<java.lang.String>, NonNullGenerator<java.lang.String>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
public class EquivalenceStringGenerator<E>
- extends CardinalGenerator<E,java.lang.String>
- implements NonNullGenerator<java.lang.String>
Generator
which generates String
s by first generating a part and a part count
and the repeating the part the generated number of times.
Created: 08.07.2011 06:20:42
- Since:
- 0.7.0
- Author:
- Volker Bergmann
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.databene.commons.ThreadAware |
isParallelizable, isThreadSafe |
currentLength
protected java.lang.Integer currentLength
EquivalenceStringGenerator
public EquivalenceStringGenerator(Generator<E> charGenerator,
NonNullGenerator<java.lang.Integer> lengthGenerator)
getGeneratedType
public java.lang.Class<java.lang.String> getGeneratedType()
- Description copied from interface:
Generator
- Declares the type of the objects returned by the generate() method.
- Specified by:
getGeneratedType
in interface Generator<java.lang.String>
init
public void init(GeneratorContext context)
- Description copied from class:
CardinalGenerator
- ensures consistency of the state
- Specified by:
init
in interface Generator<java.lang.String>
- Overrides:
init
in class CardinalGenerator<E,java.lang.String>
generate
public ProductWrapper<java.lang.String> generate(ProductWrapper<java.lang.String> wrapper)
- Description copied from interface:
Generator
- Returns an instance of the generic type E, using the
ProductWrapper
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.
- Specified by:
generate
in interface Generator<java.lang.String>
generate
public java.lang.String generate()
- Specified by:
generate
in interface NonNullGenerator<java.lang.String>
reset
public void reset()
- Specified by:
reset
in interface org.databene.commons.Resettable
- Overrides:
reset
in class CardinalGenerator<E,java.lang.String>
Copyright © 2013. All Rights Reserved.