public class CollectionRandomField extends Object implements RandomField
RandomField
representing an Collection
.RND
Constructor and Description |
---|
CollectionRandomField(Supplier<Collection<?>> collectionConstructor,
RandomField elementRandomField)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
CollectionRandomField |
collectionSize(int newCollectionSize)
Sets the standard collection size.
|
int |
getCollectionSize()
Returns the standard collection size.
|
double |
getNullProbability()
Returns the probability for this field returning null.
|
Object |
nextValue()
Returns a random value.
|
CollectionRandomField |
nullProbability(double newNullProbability)
Sets the probability for this field returning null.
|
void |
setCollectionSize(int collectionSize)
Sets the standard collection size.
|
void |
setNullProbability(double nullProbability)
Sets the probability for this field returning null.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
public CollectionRandomField(Supplier<Collection<?>> collectionConstructor, RandomField elementRandomField)
collectionConstructor
- constructor to create the collectionelementRandomField
- a generator for the elementspublic Object nextValue()
RandomField
nextValue
in interface RandomField
public double getNullProbability()
nextValue()
is null, if it is 1 then every nextValue()
is null.public CollectionRandomField nullProbability(double newNullProbability)
nextValue()
is null, if it is 1 then every nextValue()
is null.newNullProbability
- the probability between 0 and 1public void setNullProbability(double nullProbability)
nextValue()
is null, if it is 1 then every nextValue()
is null.nullProbability
- the probability between 0 and 1public int getCollectionSize()
public CollectionRandomField collectionSize(int newCollectionSize)
newCollectionSize
- collection sizepublic void setCollectionSize(int collectionSize)
collectionSize
- collection sizeCopyright © 2020. All rights reserved.