org.databene.benerator.primitive
Class BooleanGenerator
java.lang.Object
org.databene.benerator.util.AbstractGenerator<E>
org.databene.benerator.util.AbstractNonNullGenerator<E>
org.databene.benerator.util.ThreadSafeNonNullGenerator<java.lang.Boolean>
org.databene.benerator.primitive.BooleanGenerator
- All Implemented Interfaces:
- java.io.Closeable, Generator<java.lang.Boolean>, NonNullGenerator<java.lang.Boolean>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
public class BooleanGenerator
- extends ThreadSafeNonNullGenerator<java.lang.Boolean>
Generates boolean values with a configurable quota of true values.
Created: 09.06.2006 20:03:18
Constructor Summary |
BooleanGenerator()
Initializes the generator to a trueQuota of 50% |
BooleanGenerator(double trueQuota)
Initializes the generator to a trueQuota |
Method Summary |
java.lang.Boolean |
generate()
generates boolean values with a quota of true values according to the trueQuota property |
java.lang.Class<java.lang.Boolean> |
getGeneratedType()
Declares the type of the objects returned by the generate() method. |
double |
getTrueQuota()
Sets the quota of true values to create |
void |
setTrueQuota(double trueQuota)
Returns the quota of true values to create |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.databene.commons.Resettable |
reset |
BooleanGenerator
public BooleanGenerator()
- Initializes the generator to a trueQuota of 50%
BooleanGenerator
public BooleanGenerator(double trueQuota)
- Initializes the generator to a trueQuota
getTrueQuota
public double getTrueQuota()
- Sets the quota of true values to create
setTrueQuota
public void setTrueQuota(double trueQuota)
- Returns the quota of true values to create
getGeneratedType
public java.lang.Class<java.lang.Boolean> getGeneratedType()
- Description copied from interface:
Generator
- Declares the type of the objects returned by the generate() method.
generate
public java.lang.Boolean generate()
- generates boolean values with a quota of true values according to the trueQuota property
- Specified by:
generate
in interface NonNullGenerator<java.lang.Boolean>
- Specified by:
generate
in class AbstractNonNullGenerator<java.lang.Boolean>
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractGenerator<java.lang.Boolean>
Copyright © 2013. All Rights Reserved.