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 final int
    Default size hint for generators: 100
    static final int
    Default tries to check a property: 1000
    static final Supplier<Random>
    A thread-safe, equally distributed random number generator.
  • Method Summary

    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
    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.
    default CheckResult
    check(int size, int tries)
    Checks this property using the default random number generator RNG.
    check(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 Details

    • RNG

      static final Supplier<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:
    • DEFAULT_TRIES

      static final int DEFAULT_TRIES
      Default tries to check a property: 1000
      See Also:
  • Method Details

    • check

      CheckResult check(Random randomNumberGenerator, int size, int tries)
      Checks this property.
      Parameters:
      randomNumberGenerator - An implementation of Random.
      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 generator RNG.
      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 generator RNG by calling check(int, int), where size is DEFAULT_SIZE and tries is DEFAULT_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
    • or

      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 - A Checkable
      Returns:
      A new Checkable