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.
Interface for checkable properties, allowing composition via and(Checkable) and or(Checkable).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default size hint for generators: 100static final int
Default tries to check a property: 1000A thread-safe, equally distributed random number generator. -
Method Summary
Modifier and TypeMethodDescriptiondefault 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
.Checks this property.default Checkable
Returns a new Checkable which is satisfied if this Checkable or the given checkable are satisfied.
-
Field Details
-
RNG
A thread-safe, equally distributed random number generator. -
DEFAULT_SIZE
static final int DEFAULT_SIZEDefault size hint for generators: 100- See Also:
-
DEFAULT_TRIES
static final int DEFAULT_TRIESDefault tries to check a property: 1000- See Also:
-
-
Method Details
-
check
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
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
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
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
-
or
Returns a new Checkable which is satisfied if this Checkable or the given checkable are satisfied.First this Checkable is checked.
- Parameters:
checkable
- A Checkable- Returns:
- A new Checkable
-