Top Description Inners Methods
io.vavr.test

public Interface CheckResult

Known Direct Implementers
io.vavr.test.CheckResult.Satisfied, io.vavr.test.CheckResult.Falsified, io.vavr.test.CheckResult.Erroneous
Imports
io.vavr.Tuple, io.vavr.control.Option, java.io.Serializable, java.util.Objects

Represents the result of a property check which is Please note that a Satisfied property check may be Exhausted, if the property is an implication and no sample could be found that satisfied the pre-condition. In this case the post-condition is satisfied by definition (see ex falso quodlibet).
Author
Daniel Dietrich

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CheckResult.Erroneous

Represents an erroneous property check.

public static class
CheckResult.Falsified

Represents a falsified property check.

public static class
CheckResult.Satisfied

Represents a satisfied property check.

Method Summary

Modifier and TypeMethod and Description
public default void
assertIsErroneous()

Asserts that this CheckResult is erroneous.

public default void
assertIsFalsified()

Asserts that this CheckResult is falsified.

public default void
assertIsSatisfied()

Asserts that this CheckResult is satisfied.

public default void
assertIsSatisfiedWithExhaustion(boolean
The exhausted state to be checked in the case of a satisfied CheckResult.
exhausted
)

Asserts that this CheckResult is satisfied with a given exhausted state.

public int

Returns:

the number of checks performed
count
()

The number of checks performed using random generated input data.

public Option<Error>

Returns:

an optional error
error
()

An optional error.

public boolean

Returns:

true, if this check result is erroneous, false otherwise
isErroneous
()

If this check result is erroneous as specified above.

public boolean

Returns:

true, if this check result is exhausted, false otherwise
isExhausted
()

If this check result is exhausted as specified above.

public boolean

Returns:

true, if this check result is falsified, false otherwise
isFalsified
()

If this check result is falsified as specified above.

public boolean

Returns:

true, if this check result is satisfied, false otherwise
isSatisfied
()

If this check result is satisfied as specified above.

public String

Returns:

a property name
propertyName
()

The name of the checked property this result refers to.

public Option<Tuple>

Returns:

an optional sample
sample
()

An optional sample which falsified the property or which lead to an error.

Method Detail

assertIsErroneousback to summary
public default void assertIsErroneous()

Asserts that this CheckResult is erroneous.

Exceptions
AssertionError:
if this CheckResult is not erroneous.
assertIsFalsifiedback to summary
public default void assertIsFalsified()

Asserts that this CheckResult is falsified.

Exceptions
AssertionError:
if this CheckResult is not falsified.
assertIsSatisfiedback to summary
public default void assertIsSatisfied()

Asserts that this CheckResult is satisfied.

Exceptions
AssertionError:
if this CheckResult is not satisfied.
assertIsSatisfiedWithExhaustionback to summary
public default void assertIsSatisfiedWithExhaustion(boolean exhausted)

Asserts that this CheckResult is satisfied with a given exhausted state.

Parameters
exhausted:boolean

The exhausted state to be checked in the case of a satisfied CheckResult.

Exceptions
AssertionError:
if this CheckResult is not satisfied or the exhausted state does not match.
countback to summary
public int count()

The number of checks performed using random generated input data.

Returns:int

the number of checks performed

errorback to summary
public Option<Error> error()

An optional error.

Returns:Option<Error>

an optional error

isErroneousback to summary
public boolean isErroneous()

If this check result is erroneous as specified above.

Returns:boolean

true, if this check result is erroneous, false otherwise

isExhaustedback to summary
public boolean isExhausted()

If this check result is exhausted as specified above.

Returns:boolean

true, if this check result is exhausted, false otherwise

isFalsifiedback to summary
public boolean isFalsified()

If this check result is falsified as specified above.

Returns:boolean

true, if this check result is falsified, false otherwise

isSatisfiedback to summary
public boolean isSatisfied()

If this check result is satisfied as specified above.

Returns:boolean

true, if this check result is satisfied, false otherwise

propertyNameback to summary
public String propertyName()

The name of the checked property this result refers to.

Returns:String

a property name

sampleback to summary
public Option<Tuple> sample()

An optional sample which falsified the property or which lead to an error.

Returns:Option<Tuple>

an optional sample

io.vavr.test back to summary

public Class CheckResult.Erroneous

extends Object
implements CheckResult, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, io.vavr.test.CheckResult

Represents an erroneous property check.

Field Summary

Modifier and TypeField and Description
private final int
private final Error
private final String
private final Option<Tuple>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
Erroneous(String propertyName, int count, Error error, Option<Tuple> sample)

Method Summary

Modifier and TypeMethod and Description
public int
count()

Implements io.vavr.test.CheckResult.count.

The number of checks performed using random generated input data.

pack-priv boolean
pack-priv int
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public Option<Error>
error()

Implements io.vavr.test.CheckResult.error.

An optional error.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isErroneous()

Implements io.vavr.test.CheckResult.isErroneous.

If this check result is erroneous as specified above.

public boolean
isExhausted()

Implements io.vavr.test.CheckResult.isExhausted.

If this check result is exhausted as specified above.

public boolean
isFalsified()

Implements io.vavr.test.CheckResult.isFalsified.

If this check result is falsified as specified above.

public boolean
isSatisfied()

Implements io.vavr.test.CheckResult.isSatisfied.

If this check result is satisfied as specified above.

public String
propertyName()

Implements io.vavr.test.CheckResult.propertyName.

The name of the checked property this result refers to.

public Option<Tuple>
sample()

Implements io.vavr.test.CheckResult.sample.

An optional sample which falsified the property or which lead to an error.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

countback to summary
private final int count
errorback to summary
private final Error error
propertyNameback to summary
private final String propertyName
sampleback to summary
private final Option<Tuple> sample
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

Erroneousback to summary
pack-priv Erroneous(String propertyName, int count, Error error, Option<Tuple> sample)

Method Detail

countback to summary
public int count()

Implements io.vavr.test.CheckResult.count.

Doc from io.vavr.test.CheckResult.count.

The number of checks performed using random generated input data.

Returns:int

the number of checks performed

Annotations
@Override
deepEqualsback to summary
pack-priv boolean deepEquals(Throwable t1, Throwable t2)
deepHashCodeback to summary
pack-priv int deepHashCode(Throwable t)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
errorback to summary
public Option<Error> error()

Implements io.vavr.test.CheckResult.error.

Doc from io.vavr.test.CheckResult.error.

An optional error.

Returns:Option<Error>

an optional error

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isErroneousback to summary
public boolean isErroneous()

Implements io.vavr.test.CheckResult.isErroneous.

Doc from io.vavr.test.CheckResult.isErroneous.

If this check result is erroneous as specified above.

Returns:boolean

true, if this check result is erroneous, false otherwise

Annotations
@Override
isExhaustedback to summary
public boolean isExhausted()

Implements io.vavr.test.CheckResult.isExhausted.

Doc from io.vavr.test.CheckResult.isExhausted.

If this check result is exhausted as specified above.

Returns:boolean

true, if this check result is exhausted, false otherwise

Annotations
@Override
isFalsifiedback to summary
public boolean isFalsified()

Implements io.vavr.test.CheckResult.isFalsified.

Doc from io.vavr.test.CheckResult.isFalsified.

If this check result is falsified as specified above.

Returns:boolean

true, if this check result is falsified, false otherwise

Annotations
@Override
isSatisfiedback to summary
public boolean isSatisfied()

Implements io.vavr.test.CheckResult.isSatisfied.

Doc from io.vavr.test.CheckResult.isSatisfied.

If this check result is satisfied as specified above.

Returns:boolean

true, if this check result is satisfied, false otherwise

Annotations
@Override
propertyNameback to summary
public String propertyName()

Implements io.vavr.test.CheckResult.propertyName.

Doc from io.vavr.test.CheckResult.propertyName.

The name of the checked property this result refers to.

Returns:String

a property name

Annotations
@Override
sampleback to summary
public Option<Tuple> sample()

Implements io.vavr.test.CheckResult.sample.

Doc from io.vavr.test.CheckResult.sample.

An optional sample which falsified the property or which lead to an error.

Returns:Option<Tuple>

an optional sample

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
io.vavr.test back to summary

public Class CheckResult.Falsified

extends Object
implements CheckResult, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, io.vavr.test.CheckResult

Represents a falsified property check.

Field Summary

Modifier and TypeField and Description
private final int
private final String
private final Tuple
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
Falsified(String propertyName, int count, Tuple sample)

Method Summary

Modifier and TypeMethod and Description
public int
count()

Implements io.vavr.test.CheckResult.count.

The number of checks performed using random generated input data.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public Option<Error>
error()

Implements io.vavr.test.CheckResult.error.

An optional error.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isErroneous()

Implements io.vavr.test.CheckResult.isErroneous.

If this check result is erroneous as specified above.

public boolean
isExhausted()

Implements io.vavr.test.CheckResult.isExhausted.

If this check result is exhausted as specified above.

public boolean
isFalsified()

Implements io.vavr.test.CheckResult.isFalsified.

If this check result is falsified as specified above.

public boolean
isSatisfied()

Implements io.vavr.test.CheckResult.isSatisfied.

If this check result is satisfied as specified above.

public String
propertyName()

Implements io.vavr.test.CheckResult.propertyName.

The name of the checked property this result refers to.

public Option<Tuple>
sample()

Implements io.vavr.test.CheckResult.sample.

An optional sample which falsified the property or which lead to an error.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

countback to summary
private final int count
propertyNameback to summary
private final String propertyName
sampleback to summary
private final Tuple sample
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

Falsifiedback to summary
pack-priv Falsified(String propertyName, int count, Tuple sample)

Method Detail

countback to summary
public int count()

Implements io.vavr.test.CheckResult.count.

Doc from io.vavr.test.CheckResult.count.

The number of checks performed using random generated input data.

Returns:int

the number of checks performed

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
errorback to summary
public Option<Error> error()

Implements io.vavr.test.CheckResult.error.

Doc from io.vavr.test.CheckResult.error.

An optional error.

Returns:Option<Error>

an optional error

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isErroneousback to summary
public boolean isErroneous()

Implements io.vavr.test.CheckResult.isErroneous.

Doc from io.vavr.test.CheckResult.isErroneous.

If this check result is erroneous as specified above.

Returns:boolean

true, if this check result is erroneous, false otherwise

Annotations
@Override
isExhaustedback to summary
public boolean isExhausted()

Implements io.vavr.test.CheckResult.isExhausted.

Doc from io.vavr.test.CheckResult.isExhausted.

If this check result is exhausted as specified above.

Returns:boolean

true, if this check result is exhausted, false otherwise

Annotations
@Override
isFalsifiedback to summary
public boolean isFalsified()

Implements io.vavr.test.CheckResult.isFalsified.

Doc from io.vavr.test.CheckResult.isFalsified.

If this check result is falsified as specified above.

Returns:boolean

true, if this check result is falsified, false otherwise

Annotations
@Override
isSatisfiedback to summary
public boolean isSatisfied()

Implements io.vavr.test.CheckResult.isSatisfied.

Doc from io.vavr.test.CheckResult.isSatisfied.

If this check result is satisfied as specified above.

Returns:boolean

true, if this check result is satisfied, false otherwise

Annotations
@Override
propertyNameback to summary
public String propertyName()

Implements io.vavr.test.CheckResult.propertyName.

Doc from io.vavr.test.CheckResult.propertyName.

The name of the checked property this result refers to.

Returns:String

a property name

Annotations
@Override
sampleback to summary
public Option<Tuple> sample()

Implements io.vavr.test.CheckResult.sample.

Doc from io.vavr.test.CheckResult.sample.

An optional sample which falsified the property or which lead to an error.

Returns:Option<Tuple>

an optional sample

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
io.vavr.test back to summary

public Class CheckResult.Satisfied

extends Object
implements CheckResult, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, io.vavr.test.CheckResult

Represents a satisfied property check.

Field Summary

Modifier and TypeField and Description
private final int
private final boolean
private final String
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
Satisfied(String propertyName, int count, boolean exhausted)

Method Summary

Modifier and TypeMethod and Description
public int
count()

Implements io.vavr.test.CheckResult.count.

The number of checks performed using random generated input data.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public Option<Error>
error()

Implements io.vavr.test.CheckResult.error.

An optional error.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isErroneous()

Implements io.vavr.test.CheckResult.isErroneous.

If this check result is erroneous as specified above.

public boolean
isExhausted()

Implements io.vavr.test.CheckResult.isExhausted.

If this check result is exhausted as specified above.

public boolean
isFalsified()

Implements io.vavr.test.CheckResult.isFalsified.

If this check result is falsified as specified above.

public boolean
isSatisfied()

Implements io.vavr.test.CheckResult.isSatisfied.

If this check result is satisfied as specified above.

public String
propertyName()

Implements io.vavr.test.CheckResult.propertyName.

The name of the checked property this result refers to.

public Option<Tuple>
sample()

Implements io.vavr.test.CheckResult.sample.

An optional sample which falsified the property or which lead to an error.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

countback to summary
private final int count
exhaustedback to summary
private final boolean exhausted
propertyNameback to summary
private final String propertyName
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

Satisfiedback to summary
pack-priv Satisfied(String propertyName, int count, boolean exhausted)

Method Detail

countback to summary
public int count()

Implements io.vavr.test.CheckResult.count.

Doc from io.vavr.test.CheckResult.count.

The number of checks performed using random generated input data.

Returns:int

the number of checks performed

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
errorback to summary
public Option<Error> error()

Implements io.vavr.test.CheckResult.error.

Doc from io.vavr.test.CheckResult.error.

An optional error.

Returns:Option<Error>

an optional error

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isErroneousback to summary
public boolean isErroneous()

Implements io.vavr.test.CheckResult.isErroneous.

Doc from io.vavr.test.CheckResult.isErroneous.

If this check result is erroneous as specified above.

Returns:boolean

true, if this check result is erroneous, false otherwise

Annotations
@Override
isExhaustedback to summary
public boolean isExhausted()

Implements io.vavr.test.CheckResult.isExhausted.

Doc from io.vavr.test.CheckResult.isExhausted.

If this check result is exhausted as specified above.

Returns:boolean

true, if this check result is exhausted, false otherwise

Annotations
@Override
isFalsifiedback to summary
public boolean isFalsified()

Implements io.vavr.test.CheckResult.isFalsified.

Doc from io.vavr.test.CheckResult.isFalsified.

If this check result is falsified as specified above.

Returns:boolean

true, if this check result is falsified, false otherwise

Annotations
@Override
isSatisfiedback to summary
public boolean isSatisfied()

Implements io.vavr.test.CheckResult.isSatisfied.

Doc from io.vavr.test.CheckResult.isSatisfied.

If this check result is satisfied as specified above.

Returns:boolean

true, if this check result is satisfied, false otherwise

Annotations
@Override
propertyNameback to summary
public String propertyName()

Implements io.vavr.test.CheckResult.propertyName.

Doc from io.vavr.test.CheckResult.propertyName.

The name of the checked property this result refers to.

Returns:String

a property name

Annotations
@Override
sampleback to summary
public Option<Tuple> sample()

Implements io.vavr.test.CheckResult.sample.

Doc from io.vavr.test.CheckResult.sample.

An optional sample which falsified the property or which lead to an error.

Returns:Option<Tuple>

an optional sample

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override