org.databene.benerator.wrapper
Class WrapperFactory
java.lang.Object
org.databene.benerator.wrapper.WrapperFactory
public class WrapperFactory
- extends java.lang.Object
Provides wrappers for number Generator
s that converts
their products to a target Number
type.
Created at 30.06.2009 10:48:59
- Since:
- 0.6.0
- Author:
- Volker Bergmann
Method Summary |
static
|
applyConverter(Generator<S> source,
org.databene.commons.Converter... converter)
Creates a generator that accepts products from a source generator
and converts them to target products by the converter |
static
|
applyCycler(Generator<T> generator)
|
static
|
applyHeadCycler(Generator<T> source)
|
static
|
applyLastProductDetector(Generator<T> generator)
|
static
|
applyOffset(Generator<T> generator,
int offset)
|
static
|
applyValidator(org.databene.commons.Validator<T> validator,
Generator<T> generator)
|
static
|
asNonNullGenerator(Generator<T> source)
|
static
|
asNonNullNumberGeneratorOfType(java.lang.Class<T> numberType,
NonNullGenerator<? extends java.lang.Number> source,
T min,
T granularity)
|
static
|
asNumberGeneratorOfType(java.lang.Class<T> numberType,
Generator<? extends java.lang.Number> source,
T min,
T granularity)
|
static Generator<java.lang.String> |
asStringGenerator(Generator<?> source)
|
static Generator<java.lang.String>[] |
asStringGenerators(Generator<?>[] sources)
|
static Generator<java.lang.String> |
createMessageGenerator(java.lang.String pattern,
int minLength,
int maxLength,
Generator... sources)
Creates a generator that generates messages by reading the products of several source generators and
combining them by a Java MessageFormat. |
static
|
injectNulls(Generator<T> source,
double nullQuota)
|
static
|
prependNull(Generator<T> source)
|
static
|
preventClosing(Generator<T> generator)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WrapperFactory
public WrapperFactory()
asNonNullNumberGeneratorOfType
public static <T extends java.lang.Number> NonNullGenerator<T> asNonNullNumberGeneratorOfType(java.lang.Class<T> numberType,
NonNullGenerator<? extends java.lang.Number> source,
T min,
T granularity)
asNumberGeneratorOfType
public static <T extends java.lang.Number> Generator<T> asNumberGeneratorOfType(java.lang.Class<T> numberType,
Generator<? extends java.lang.Number> source,
T min,
T granularity)
asNonNullGenerator
public static <T> NonNullGenerator<T> asNonNullGenerator(Generator<T> source)
applyConverter
public static <S,T> Generator<T> applyConverter(Generator<S> source,
org.databene.commons.Converter... converter)
- Creates a generator that accepts products from a source generator
and converts them to target products by the converter
- Parameters:
source
- the source generatorconverter
- the converter to apply to the products of the source generator
- Returns:
- a generator of the desired characteristics
createMessageGenerator
public static Generator<java.lang.String> createMessageGenerator(java.lang.String pattern,
int minLength,
int maxLength,
Generator... sources)
- Creates a generator that generates messages by reading the products of several source generators and
combining them by a Java MessageFormat.
- Parameters:
pattern
- the MessageFormat patternminLength
- the minimum length of the generated valuemaxLength
- the maximum length of the generated valuesources
- the source generators of which to assemble the products
- Returns:
- a generator of the desired characteristics
- See Also:
MessageFormat
asStringGenerators
public static Generator<java.lang.String>[] asStringGenerators(Generator<?>[] sources)
asStringGenerator
public static Generator<java.lang.String> asStringGenerator(Generator<?> source)
applyOffset
public static <T> OffsetBasedGenerator<T> applyOffset(Generator<T> generator,
int offset)
preventClosing
public static <T> Generator<T> preventClosing(Generator<T> generator)
applyValidator
public static <T> Generator<T> applyValidator(org.databene.commons.Validator<T> validator,
Generator<T> generator)
applyCycler
public static <T> Generator<T> applyCycler(Generator<T> generator)
applyHeadCycler
public static <T> Generator<T> applyHeadCycler(Generator<T> source)
prependNull
public static <T> Generator<T> prependNull(Generator<T> source)
injectNulls
public static <T> Generator<T> injectNulls(Generator<T> source,
double nullQuota)
applyLastProductDetector
public static <T> Generator<T> applyLastProductDetector(Generator<T> generator)
Copyright © 2013. All Rights Reserved.