Package nl.jqno.equalsverifier
Class EqualsVerifierReport
- java.lang.Object
-
- nl.jqno.equalsverifier.EqualsVerifierReport
-
public final class EqualsVerifierReport extends Object
Contains the results of anEqualsVerifier
run.When the run was successful, should contain an empty message and a null cause. When the run was unsuccessful, the message is identical to the message of the exception that
SingleTypeEqualsVerifierApi.verify()
would throw, and the cause would be identical to its cause.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EqualsVerifierReport
failure(Class<?> type, String message, Throwable cause)
Factory method for an unsuccessful run ofEqualsVerifier
.Throwable
getCause()
String
getMessage()
Class<?>
getType()
boolean
isSuccessful()
static EqualsVerifierReport
success(Class<?> type)
Factory method for a successful run ofEqualsVerifier
.
-
-
-
Method Detail
-
success
public static EqualsVerifierReport success(Class<?> type)
Factory method for a successful run ofEqualsVerifier
.- Parameters:
type
- The class that was tested.- Returns:
- an
EqualsVerifierReport
representing the successful result of a run ofEqualsVerifier
.
-
failure
public static EqualsVerifierReport failure(Class<?> type, String message, Throwable cause)
Factory method for an unsuccessful run ofEqualsVerifier
.- Parameters:
type
- The class that was tested.message
- Error message when the run is unsuccessful.cause
- Exception when the run is unsuccessful.- Returns:
- an
EqualsVerifierReport
representing the failed result of a run ofEqualsVerifier
.
-
getType
public Class<?> getType()
- Returns:
- the class that was tested.
-
isSuccessful
public boolean isSuccessful()
- Returns:
- whether the class tested by
SingleTypeEqualsVerifierApi.report()
conforms to theObject.equals(Object)
andObject.hashCode()
contracts.
-
getMessage
public String getMessage()
- Returns:
- a detailed error message if the class tested by
SingleTypeEqualsVerifierApi.report()
does not conform to theObject.equals(Object)
andObject.hashCode()
contracts; or an empty string if it does.
-
getCause
public Throwable getCause()
- Returns:
- an exception indicating the source of the failure if the class tested by
SingleTypeEqualsVerifierApi.report()
does not conform to theObject.equals(Object)
andObject.hashCode()
contracts; or null if it does.
-
-