Package io.vavr.test
Interface Checkable
-
- All Known Implementing Classes:
Property.Property1
,Property.Property2
,Property.Property3
,Property.Property4
,Property.Property5
,Property.Property6
,Property.Property7
,Property.Property8
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Checkable
Interface for checkable properties, allowing composition via and(Checkable) and or(Checkable).
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SIZE
Default size hint for generators: 100static int
DEFAULT_TRIES
Default tries to check a property: 1000static java.util.function.Supplier<java.util.Random>
RNG
A thread-safe, equally distributed random number generator.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Checkable
and(Checkable checkable)
Returns a new Checkable which is satisfied if this Checkable and the given checkable are satisfied.default CheckResult
check()
Checks this property using the default random number generatorRNG
by callingcheck(int, int)
, where size isDEFAULT_SIZE
and tries isDEFAULT_TRIES
.default CheckResult
check(int size, int tries)
Checks this property using the default random number generatorRNG
.CheckResult
check(java.util.Random randomNumberGenerator, int size, int tries)
Checks this property.default Checkable
or(Checkable checkable)
Returns a new Checkable which is satisfied if this Checkable or the given checkable are satisfied.
-
-
-
Field Detail
-
RNG
static final java.util.function.Supplier<java.util.Random> RNG
A thread-safe, equally distributed random number generator.
-
DEFAULT_SIZE
static final int DEFAULT_SIZE
Default size hint for generators: 100- See Also:
- Constant Field Values
-
DEFAULT_TRIES
static final int DEFAULT_TRIES
Default tries to check a property: 1000- See Also:
- Constant Field Values
-
-
Method Detail
-
check
CheckResult check(java.util.Random randomNumberGenerator, int size, int tries)
Checks this property.- Parameters:
randomNumberGenerator
- An implementation ofRandom
.size
- A (not necessarily positive) size hint.tries
- A non-negative number of tries to falsify the given property.- Returns:
- A CheckResult
-
check
default CheckResult check(int size, int tries)
Checks this property using the default random number generatorRNG
.- Parameters:
size
- A (not necessarily positive) size hint.tries
- A non-negative number of tries to falsify the given property.- Returns:
- A CheckResult
-
check
default CheckResult check()
Checks this property using the default random number generatorRNG
by callingcheck(int, int)
, where size isDEFAULT_SIZE
and tries isDEFAULT_TRIES
.- Returns:
- A CheckResult
-
and
default Checkable and(Checkable checkable)
Returns a new Checkable which is satisfied if this Checkable and the given checkable are satisfied.First this Checkable is checked.
- Parameters:
checkable
- A Checkable- Returns:
- A new Checkable
-
-