T
- The type of the matched entity.@HashCodeAndEqualsPlugin.Enhance public class MethodOverrideMatcher<T extends MethodDescription> extends ElementMatcher.Junction.AbstractBase<T>
ElementMatcher.Junction.AbstractBase<V>, ElementMatcher.Junction.Conjunction<W>, ElementMatcher.Junction.Disjunction<W>
ElementMatcher.Junction<S>
Modifier and Type | Field and Description |
---|---|
private ElementMatcher<? super TypeDescription.Generic> |
matcher
The matcher that is to be applied to the type that declares a method of the same shape.
|
Constructor and Description |
---|
MethodOverrideMatcher(ElementMatcher<? super TypeDescription.Generic> matcher)
Creates a new method override matcher.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
matches(MethodDescription target,
java.util.List<? extends TypeDefinition> typeDefinitions,
java.util.Set<TypeDescription> duplicates)
Matches a method against a list of types.
|
private boolean |
matches(MethodDescription target,
TypeDefinition typeDefinition)
Checks if a type declares a method with the same signature as
target . |
boolean |
matches(T target)
Matches a target against this element matcher.
|
java.lang.String |
toString() |
and, or
private final ElementMatcher<? super TypeDescription.Generic> matcher
public MethodOverrideMatcher(ElementMatcher<? super TypeDescription.Generic> matcher)
matcher
- The matcher that is to be applied to the type that declares a method of the same shape.public boolean matches(T target)
target
- The instance to be matched.true
if the given element is matched by this matcher or false
otherwise.private boolean matches(MethodDescription target, java.util.List<? extends TypeDefinition> typeDefinitions, java.util.Set<TypeDescription> duplicates)
target
- The method that is matched as a target.typeDefinitions
- The type definitions to check if they declare a method with the same signature as target
.duplicates
- A set containing duplicate interfaces that do not need to be revisited.true
if any type defines a method with the same signature as the target
method.private boolean matches(MethodDescription target, TypeDefinition typeDefinition)
target
.target
- The method to be checked.typeDefinition
- The type to check for declaring a method with the same signature as target
.true
if the supplied type declares a compatible method.public java.lang.String toString()
toString
in class java.lang.Object