Top Description Fields Methods
io.vavr.test

public Interface Checkable

Known Direct Implementers
io.vavr.test.Property.Property1, io.vavr.test.Property.Property2, io.vavr.test.Property.Property3, io.vavr.test.Property.Property4, io.vavr.test.Property.Property5, io.vavr.test.Property.Property6, io.vavr.test.Property.Property7, io.vavr.test.Property.Property8
Annotations
@FunctionalInterface
Imports
java.util.Random, java.util.concurrent.ThreadLocalRandom, java.util.function.Supplier

Interface for checkable properties, allowing composition via and(Checkable) and or(Checkable).
Author
Daniel Dietrich

Field Summary

Modifier and TypeField and Description
public static final int
DEFAULT_SIZE

Default size hint for generators: 100

public static final int
DEFAULT_TRIES

Default tries to check a property: 1000

public static final Supplier<Random>
RNG

A thread-safe, equally distributed random number generator.

Method Summary

Modifier and TypeMethod and Description
public default Checkable

Returns:

A new Checkable
and
(Checkable
A Checkable
checkable
)

Returns a new Checkable which is satisfied if this Checkable and the given checkable are satisfied.

public CheckResult

Returns:

A CheckResult
check
(Random
An implementation of java.util.Random.
randomNumberGenerator
,
int
A (not necessarily positive) size hint.
size
,
int
A non-negative number of tries to falsify the given property.
tries
)

Checks this property.

public default CheckResult

Returns:

A CheckResult
check
(int
A (not necessarily positive) size hint.
size
,
int
A non-negative number of tries to falsify the given property.
tries
)

Checks this property using the default random number generator RNG.

public default CheckResult

Returns:

A CheckResult
check
()

Checks this property using the default random number generator RNG by calling check(int, int), where size is DEFAULT_SIZE and tries is DEFAULT_TRIES.

public default Checkable

Returns:

A new Checkable
or
(Checkable
A Checkable
checkable
)

Returns a new Checkable which is satisfied if this Checkable or the given checkable are satisfied.

Field Detail

DEFAULT_SIZEback to summary
public static final int DEFAULT_SIZE

Default size hint for generators: 100

DEFAULT_TRIESback to summary
public static final int DEFAULT_TRIES

Default tries to check a property: 1000

RNGback to summary
public static final Supplier<Random> RNG

A thread-safe, equally distributed random number generator.

Method Detail

andback to summary
public 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:Checkable

A Checkable

Returns:Checkable

A new Checkable

checkback to summary
public CheckResult check(Random randomNumberGenerator, int size, int tries)

Checks this property.

Parameters
randomNumberGenerator:Random

An implementation of java.util.Random.

size:int

A (not necessarily positive) size hint.

tries:int

A non-negative number of tries to falsify the given property.

Returns:CheckResult

A CheckResult

checkback to summary
public default CheckResult check(int size, int tries)

Checks this property using the default random number generator RNG.

Parameters
size:int

A (not necessarily positive) size hint.

tries:int

A non-negative number of tries to falsify the given property.

Returns:CheckResult

A CheckResult

checkback to summary
public default CheckResult check()

Checks this property using the default random number generator RNG by calling check(int, int), where size is DEFAULT_SIZE and tries is DEFAULT_TRIES.

Returns:CheckResult

A CheckResult

orback to summary
public default Checkable or(Checkable checkable)

Returns a new Checkable which is satisfied if this Checkable or the given checkable are satisfied.

First this Checkable is checked.

Parameters
checkable:Checkable

A Checkable

Returns:Checkable

A new Checkable