org.progeeks.tool.gen
Class BooleanGenerator
java.lang.Object
org.progeeks.tool.gen.BaseDataGenerator
org.progeeks.tool.gen.BooleanGenerator
- All Implemented Interfaces:
- DataGenerator
public class BooleanGenerator
- extends BaseDataGenerator
Generates a random Boolean value using the set positiveWeight
to determine the
percentage of true vs false returns. If you want to always generate true or false,
use an EqualsGenerator
instead.
Field Summary |
protected static Log |
log
|
Methods inherited from class org.progeeks.tool.gen.BaseDataGenerator |
generateData, getAllowNull, getDataClass, getDataClazz, getEnforceResolvable, getNullPercentage, isDataValid, setAllowNull, setDataClass, setEnforceResolvable, setNullPercentage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
log
protected static final Log log
BooleanGenerator
public BooleanGenerator()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
generateRealData
protected java.lang.Object generateRealData(DataGeneratorContext context)
- Description copied from class:
BaseDataGenerator
- Left for sub-classes. Subclasses should usually not return null from this.
- Specified by:
generateRealData
in class BaseDataGenerator
testData
protected boolean testData(java.lang.Object testItem,
DataGeneratorContext context)
- Description copied from class:
BaseDataGenerator
- Left for sub-classes. Subclasses do not have to check for null.
- Specified by:
testData
in class BaseDataGenerator
getPositiveWeight
public float getPositiveWeight()
- Returns:
- Returns the positiveWeight.
setPositiveWeight
public void setPositiveWeight(float weight)
- Set the percentage of time that the generator will return true. Defaults to 50%.
- Parameters:
positiveWeight
- The positiveWeight to set. Should be less than 1.0.
Copyright © 2002-2003 Paul Speed. All Rights Reserved.