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.
- Since:
- 3.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEqualsVerifierReport(Class<?> type, boolean successful, String message, Throwable cause) Private constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic EqualsVerifierReportFactory method for an unsuccessful run ofEqualsVerifier.getCause()Returns the exception that detected the failure of the tested class to conform to theequals()andhashCode()contracts.Returns a detailed error message if the tested class does not conform to theequals()andhashCode()contracts.Class<?> getType()Returns the class that was tested.booleanReturns whether the tested class conforms to theequals()andhashCode()contracts.static EqualsVerifierReportFactory method for a successful run ofEqualsVerifier.
-
Field Details
-
type
-
successful
private final boolean successful -
message
-
cause
-
-
Constructor Details
-
EqualsVerifierReport
Private constructor. Usesuccess(Class)orfailure(Class, String, Throwable)instead.
-
-
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. - Since:
- 3.2
-
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. - Since:
- 3.2
-
getType
Returns the class that was tested.- Returns:
- the class that was tested.
- Since:
- 3.2
-
isSuccessful
public boolean isSuccessful()Returns whether the tested class conforms to theequals()andhashCode()contracts.- Returns:
- whether the class tested by
SingleTypeEqualsVerifierApi.report()conforms to theObject.equals(Object)andObject.hashCode()contracts. - Since:
- 3.0
-
getMessage
Returns a detailed error message if the tested class does not conform to theequals()andhashCode()contracts.- 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. - Since:
- 3.0
-
getCause
Returns the exception that detected the failure of the tested class to conform to theequals()andhashCode()contracts.- 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. - Since:
- 3.0
-