Package net.andreinc.mockneat.unit.types
Class Bools
java.lang.Object
net.andreinc.mockneat.abstraction.MockUnitBase
net.andreinc.mockneat.unit.types.Bools
- All Implemented Interfaces:
MockUnit<java.lang.Boolean>
public class Bools extends MockUnitBase implements MockUnit<java.lang.Boolean>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description static Boolsbools()Returns aBoolsobject that can be used to generate arbitraryBooleanvalues.MockUnit<java.lang.Boolean>probability(double probability)Returns a newMockUnit<Boolean>that returns arbitrary boolean values with a given probability.java.util.function.Supplier<java.lang.Boolean>supplier()Returns the internalSupplier<Boolean>that is used to generate boolean values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.andreinc.mockneat.abstraction.MockUnit
array, array, collection, collection, collection, collection, collection, collection, consume, consume, get, get, list, list, list, list, list, list, map, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapToDouble, mapToInt, mapToLocalDate, mapToLong, mapToString, mapToString, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, serialize, set, set, set, set, set, set, stream, val, val, valStr, valStr
-
Constructor Details
-
Method Details
-
bools
Returns a
Boolsobject that can be used to generate arbitraryBooleanvalues.- Returns:
- A re-usable
Boolsinstance. The class implementsMockUnit<Boolean>.
-
probability
Returns a new
MockUnit<Boolean>that returns arbitrary boolean values with a given probability.- Parameters:
probability- The probability to obtaintrue. (Eg.: If the probability is 99.99, theMockUnit<Boolean>will generatetruein 99.99% of the cases.- Returns:
- A new
MockUnit<Boolean>
-
supplier
public java.util.function.Supplier<java.lang.Boolean> supplier()Returns the internal
Supplier<Boolean>that is used to generate boolean values.
-