Top Description Inners Fields Constructors Methods
net.bytebuddy.matcher

public Class MethodSortMatcher<T extends net.bytebuddy.description.method.MethodDescription>

extends ElementMatcher.Junction.ForNonNullValues<T extends MethodDescription>
Class Inheritance
Annotations
@Enhance
Type Parameters
<T>
The type of the matched entity.
Imports
net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.method.MethodDescription

Matches a method description by its general characteristics which are represented as a net.bytebuddy.matcher.MethodSortMatcher.Sort.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
MethodSortMatcher.Sort

Represents a specific characteristic of a method description.

Field Summary

Modifier and TypeField and Description
private final MethodSortMatcher.Sort
sort

The sort of method description to be matched by this element matcher.

Constructor Summary

AccessConstructor and Description
public
MethodSortMatcher(MethodSortMatcher.Sort
The sort of method description to be matched by this element matcher.
sort
)

Creates a new element matcher that matches a specific sort of method description.

Method Summary

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

Implements abstract net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Matches the supplied value if it was found not to be null.
public static <
The type of the matched entity.
T extends MethodDescription
>
ElementMatcher.Junction<T>

Returns:

A matcher that matches methods of the provided sort.
of
(MethodSortMatcher.Sort
The sort of method description to be matched by this element matcher.
sort
)

Returns an element matcher that matches a specific sort of method description.

public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

sortback to summary
private final MethodSortMatcher.Sort sort

The sort of method description to be matched by this element matcher.

Constructor Detail

MethodSortMatcherback to summary
public MethodSortMatcher(MethodSortMatcher.Sort sort)

Creates a new element matcher that matches a specific sort of method description.

Parameters
sort:MethodSortMatcher.Sort

The sort of method description to be matched by this element matcher.

Method Detail

doMatchback to summary
protected boolean doMatch(T target)

Implements abstract net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Doc from net.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.

ofback to summary
public static <T extends MethodDescription> ElementMatcher.Junction<T> of(MethodSortMatcher.Sort sort)

Returns an element matcher that matches a specific sort of method description.

Parameters
<T>
The type of the matched entity.
sort:MethodSortMatcher.Sort

The sort of method description to be matched by this element matcher.

Returns:ElementMatcher.Junction<T>

A matcher that matches methods of the provided sort.

Annotations
@SuppressWarnings:unchecked
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
net.bytebuddy.matcher back to summary

public sealed Enum MethodSortMatcher.Sort

extends Enum<MethodSortMatcher.Sort>
Class Inheritance

Represents a specific characteristic of a method description.

Field Summary

Modifier and TypeField and Description
public static final MethodSortMatcher.Sort
CONSTRUCTOR

Matches method descriptions that represent constructors, not methods or the type initializer.

public static final MethodSortMatcher.Sort
DEFAULT_METHOD

Matches method descriptions that represent Java 8 default methods.

private final String
description

A textual representation of the method sort that is represented by this instance.

private final MethodSortMatcher<?>
matcher

A reusable matcher for this sort.

public static final MethodSortMatcher.Sort
METHOD

Matches method descriptions that represent methods, not constructors or the type initializer.

public static final MethodSortMatcher.Sort
TYPE_INITIALIZER

Matches method descriptions that represent the type initializers.

public static final MethodSortMatcher.Sort
VIRTUAL

Matches method descriptions that are overridable.

Constructor Summary

AccessConstructor and Description
private
Sort(String
A textual representation of the method sort that is represented by this instance.
description
)

Creates a new method sort representation.

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

A textual representation of this instance's method sort.
getDescription
()

Returns a textual representation of this instance's method sort.

protected MethodSortMatcher<?>

Returns:

The predefined matcher for this method sort.
getMatcher
()

Returns the predefined matcher for this method sort.

protected abstract boolean

Returns:

true if the given method if of the method sort that is represented by this instance.
isSort
(MethodDescription
A textual representation of the method sort that is represented by this instance.
target
)

Determines if a method description is of the represented method sort.

public static MethodSortMatcher.Sort
public static MethodSortMatcher.Sort[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CONSTRUCTORback to summary
public static final MethodSortMatcher.Sort CONSTRUCTOR

Matches method descriptions that represent constructors, not methods or the type initializer.

DEFAULT_METHODback to summary
public static final MethodSortMatcher.Sort DEFAULT_METHOD

Matches method descriptions that represent Java 8 default methods.

descriptionback to summary
private final String description

A textual representation of the method sort that is represented by this instance.

matcherback to summary
private final MethodSortMatcher<?> matcher

A reusable matcher for this sort.

METHODback to summary
public static final MethodSortMatcher.Sort METHOD

Matches method descriptions that represent methods, not constructors or the type initializer.

TYPE_INITIALIZERback to summary
public static final MethodSortMatcher.Sort TYPE_INITIALIZER

Matches method descriptions that represent the type initializers.

VIRTUALback to summary
public static final MethodSortMatcher.Sort VIRTUAL

Matches method descriptions that are overridable.

Constructor Detail

Sortback to summary
private Sort(String description)

Creates a new method sort representation.

Parameters
description:String

A textual representation of the method sort that is represented by this instance.

Method Detail

getDescriptionback to summary
protected String getDescription()

Returns a textual representation of this instance's method sort.

Returns:String

A textual representation of this instance's method sort.

getMatcherback to summary
protected MethodSortMatcher<?> getMatcher()

Returns the predefined matcher for this method sort.

Returns:MethodSortMatcher<?>

The predefined matcher for this method sort.

isSortback to summary
protected abstract boolean isSort(MethodDescription target)

Determines if a method description is of the represented method sort.

Parameters
target:MethodDescription

A textual representation of the method sort that is represented by this instance.

Returns:boolean

true if the given method if of the method sort that is represented by this instance.

valueOfback to summary
public static MethodSortMatcher.Sort valueOf(String name)
valuesback to summary
public static MethodSortMatcher.Sort[] values()