public final class ConfiguredEqualsVerifier
extends java.lang.Object
Constructor | Description |
---|---|
ConfiguredEqualsVerifier() |
Modifier and Type | Method | Description |
---|---|---|
<T> EqualsVerifierApi<T> |
forClass(java.lang.Class<T> type) |
Factory method.
|
ConfiguredEqualsVerifier |
suppress(Warning... warnings) |
Suppresses warnings given by
EqualsVerifier . |
ConfiguredEqualsVerifier |
usingGetClass() |
Signals that
getClass is used in the implementation of the
equals method, instead of an instanceof check. |
<S> ConfiguredEqualsVerifier |
withGenericPrefabValues(java.lang.Class<S> otherType,
Func.Func1<?,S> factory) |
Adds a factory to generate prefabricated values for instance fields of
classes with 1 generic type parameter that EqualsVerifier cannot
instantiate by itself.
|
<S> ConfiguredEqualsVerifier |
withGenericPrefabValues(java.lang.Class<S> otherType,
Func.Func2<?,?,S> factory) |
Adds a factory to generate prefabricated values for instance fields of
classes with 2 generic type parameters that EqualsVerifier cannot
instantiate by itself.
|
<S> ConfiguredEqualsVerifier |
withPrefabValues(java.lang.Class<S> otherType,
S red,
S black) |
Adds prefabricated values for instance fields of classes that
EqualsVerifier cannot instantiate by itself.
|
public ConfiguredEqualsVerifier suppress(Warning... warnings)
EqualsVerifier
. See Warning
to see what warnings can be suppressed.warnings
- A list of warnings to suppress in
EqualsVerifier
.this
, for easy method chaining.public <S> ConfiguredEqualsVerifier withPrefabValues(java.lang.Class<S> otherType, S red, S black)
S
- The class of the prefabricated values.otherType
- The class of the prefabricated values.red
- An instance of S
.black
- Another instance of S
, not equal to red
.this
, for easy method chaining.java.lang.NullPointerException
- If either otherType
, red
,
or black
is null.java.lang.IllegalArgumentException
- If red
equals black
.public <S> ConfiguredEqualsVerifier withGenericPrefabValues(java.lang.Class<S> otherType, Func.Func1<?,S> factory)
S
- The class of the prefabricated values.otherType
- The class of the prefabricated values.factory
- A factory to generate an instance of S
, given a
value of its generic type parameter.this
, for easy method chaining.java.lang.NullPointerException
- if either otherType
or
factory
is null.public <S> ConfiguredEqualsVerifier withGenericPrefabValues(java.lang.Class<S> otherType, Func.Func2<?,?,S> factory)
S
- The class of the prefabricated values.otherType
- The class of the prefabricated values.factory
- A factory to generate an instance of S
, given a
value of each of its generic type parameters.this
, for easy method chaining.java.lang.NullPointerException
- if either otherType
or
factory
is null.public ConfiguredEqualsVerifier usingGetClass()
getClass
is used in the implementation of the
equals
method, instead of an instanceof
check.this
, for easy method chaining.public <T> EqualsVerifierApi<T> forClass(java.lang.Class<T> type)
T
- The type.type
- The class for which the equals
method should be
tested.Copyright © 2018. All Rights Reserved.