@FunctionalInterface public interface UniformMatcher<T> extends Matcher<T,T>
Matcher which can only compare
objects of the same type.
Besides IDENTICAL which only accepts the same object as identical,
useful standard implementations are also
Objects::equals or Objects::deepEquals.
HashCodeCalculator| Modifier and Type | Field and Description |
|---|---|
static UniformMatcher<java.lang.Object> |
IDENTICAL
Uniform matcher which only accepts identical objects.
|
static UniformMatcher<java.lang.Object> |
NATURAL
Uniform matcher which uses
Object.equals(Object). |
static UniformMatcher<java.lang.Object> |
NATURAL_NULL_SAFE
Uniform matcher which uses
Objects.deepEquals(Object, Object). |
| Modifier and Type | Method and Description |
|---|---|
static <V> UniformMatcher<V> |
identical()
Identical matcher.
|
static <V> UniformMatcher<V> |
natural()
Natural matcher.
|
static <V> UniformMatcher<V> |
naturalNullSafe()
Natural matcher.
|
static final UniformMatcher<java.lang.Object> IDENTICAL
identical().static final UniformMatcher<java.lang.Object> NATURAL
Object.equals(Object).
Attention: this is fast but not null-safe.
Don't use directly, prefer natural().static final UniformMatcher<java.lang.Object> NATURAL_NULL_SAFE
Objects.deepEquals(Object, Object).
Don't use directly, prefer @NotNull static <V> UniformMatcher<V> identical()
IDENTICAL but may be used in cases when
the interface does not accept matchers with a super type.V - value type@NotNull static <V> UniformMatcher<V> natural()
NATURAL but may be used in cases when
the interface does not accept matchers with a super type.
Attention: this is fast but not null-safe.V - value type@NotNull static <V> UniformMatcher<V> naturalNullSafe()
NATURAL_NULL_SAFE but may be used in cases when
the interface does not accept matchers with a super type.V - value type