Package nl.jqno.equalsverifier
Class EqualsVerifierReport
java.lang.Object
nl.jqno.equalsverifier.EqualsVerifierReport
Contains the results of an
EqualsVerifier 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
Modifier and TypeMethodDescriptionstatic EqualsVerifierReportFactory method for an unsuccessful run ofEqualsVerifier.getCause()Class<?>getType()booleanstatic EqualsVerifierReportFactory method for a successful run ofEqualsVerifier.
-
Method Details
-
success
Factory method for a successful run ofEqualsVerifier.- Parameters:
type- The class that was tested.- Returns:
- an
EqualsVerifierReportrepresenting the successful result of a run ofEqualsVerifier.
-
failure
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
EqualsVerifierReportrepresenting the failed result of a run ofEqualsVerifier.
-
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
- 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
- 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.
-