Top Description Fields Constructors Methods
org.easymock.bytebuddy.matcher

public Class MethodOverrideMatcher<T extends MethodDescription>

extends ElementMatcher.Junction.ForNonNullValues<T extends MethodDescription>
Class Inheritance
Annotations
@Enhance
Type Parameters
<T>
The type of the matched entity.
Imports
org.easymock.bytebuddy.build.HashCodeAndEqualsPlugin, org.easymock.bytebuddy.description.method.MethodDescription, org.easymock.bytebuddy.description.type.TypeDefinition, .TypeDescription, java.util.HashSet, .List, .Set

A matcher that checks if any super type of a type declares a method with the same shape of a matched method.

Field Summary

Modifier and TypeField and Description
private final ElementMatcher<? super TypeDescription.Generic>
matcher

The matcher that is to be applied to the type that declares a method of the same shape.

Constructor Summary

AccessConstructor and Description
public
MethodOverrideMatcher(ElementMatcher<? super TypeDescription.Generic>
The matcher that is to be applied to the type that declares a method of the same shape.
matcher
)

Creates a new method override matcher.

Method Summary

Modifier and TypeMethod and Description
protected boolean
doMatch(T
The instance to be matched.
target
)

Implements abstract org.easymock.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Matches the supplied value if it was found not to be null.
private boolean

Returns:

true if any type defines a method with the same signature as the target method.
matches
(MethodDescription
The method that is matched as a target.
target
,
List<? extends TypeDefinition>
The type definitions to check if they declare a method with the same signature as target.
typeDefinitions
,
Set<TypeDescription>
A set containing duplicate interfaces that do not need to be revisited.
duplicates
)

Matches a method against a list of types.

private boolean

Returns:

true if the supplied type declares a compatible method.
matches
(MethodDescription
The method to be checked.
target
,
TypeDefinition
The type to check for declaring a method with the same signature as target.
typeDefinition
)

Checks if a type declares a method with the same signature as target.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.easymock.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues:
matches

Field Detail

matcherback to summary
private final ElementMatcher<? super TypeDescription.Generic> matcher

The matcher that is to be applied to the type that declares a method of the same shape.

Constructor Detail

MethodOverrideMatcherback to summary
public MethodOverrideMatcher(ElementMatcher<? super TypeDescription.Generic> matcher)

Creates a new method override matcher.

Parameters
matcher:ElementMatcher<? super TypeDescription.Generic>

The matcher that is to be applied to the type that declares a method of the same shape.

Method Detail

doMatchback to summary
protected boolean doMatch(T target)

Implements abstract org.easymock.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Doc from org.easymock.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Matches the supplied value if it was found not to be null.

Parameters
target:T

The instance to be matched.

Returns:boolean

true if the given element is matched by this matcher or false otherwise.

matchesback to summary
private boolean matches(MethodDescription target, List<? extends TypeDefinition> typeDefinitions, Set<TypeDescription> duplicates)

Matches a method against a list of types.

Parameters
target:MethodDescription

The method that is matched as a target.

typeDefinitions:List<? extends TypeDefinition>

The type definitions to check if they declare a method with the same signature as target.

duplicates:Set<TypeDescription>

A set containing duplicate interfaces that do not need to be revisited.

Returns:boolean

true if any type defines a method with the same signature as the target method.

matchesback to summary
private boolean matches(MethodDescription target, TypeDefinition typeDefinition)

Checks if a type declares a method with the same signature as target.

Parameters
target:MethodDescription

The method to be checked.

typeDefinition:TypeDefinition

The type to check for declaring a method with the same signature as target.

Returns:boolean

true if the supplied type declares a compatible method.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override