Package net.bytebuddy.matcher
Enum MethodSortMatcher.Sort
- java.lang.Object
-
- java.lang.Enum<MethodSortMatcher.Sort>
-
- net.bytebuddy.matcher.MethodSortMatcher.Sort
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<MethodSortMatcher.Sort>
- Enclosing class:
- MethodSortMatcher<T extends MethodDescription>
public static enum MethodSortMatcher.Sort extends java.lang.Enum<MethodSortMatcher.Sort>
Represents a specific characteristic of a method description.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONSTRUCTORMatches method descriptions that represent constructors, not methods or the type initializer.DEFAULT_METHODMatches method descriptions that represent Java 8 default methods.METHODMatches method descriptions that represent methods, not constructors or the type initializer.TYPE_INITIALIZERMatches method descriptions that represent the type initializers.VIRTUALMatches method descriptions that are overridable.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdescriptionA textual representation of the method sort that is represented by this instance.private MethodSortMatcher<?>matcherA reusable matcher for this sort.
-
Constructor Summary
Constructors Modifier Constructor Description privateSort(java.lang.String description)Creates a new method sort representation.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetDescription()Returns a textual representation of this instance's method sort.protected MethodSortMatcher<?>getMatcher()Returns the predefined matcher for this method sort.protected abstract booleanisSort(MethodDescription target)Determines if a method description is of the represented method sort.static MethodSortMatcher.SortvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MethodSortMatcher.Sort[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
METHOD
public static final MethodSortMatcher.Sort METHOD
Matches method descriptions that represent methods, not constructors or the type initializer.
-
CONSTRUCTOR
public static final MethodSortMatcher.Sort CONSTRUCTOR
Matches method descriptions that represent constructors, not methods or the type initializer.
-
TYPE_INITIALIZER
public static final MethodSortMatcher.Sort TYPE_INITIALIZER
Matches method descriptions that represent the type initializers.
-
VIRTUAL
public static final MethodSortMatcher.Sort VIRTUAL
Matches method descriptions that are overridable.
-
DEFAULT_METHOD
public static final MethodSortMatcher.Sort DEFAULT_METHOD
Matches method descriptions that represent Java 8 default methods.
-
-
Field Detail
-
description
private final java.lang.String description
A textual representation of the method sort that is represented by this instance.
-
matcher
private final MethodSortMatcher<?> matcher
A reusable matcher for this sort.
-
-
Method Detail
-
values
public static MethodSortMatcher.Sort[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MethodSortMatcher.Sort c : MethodSortMatcher.Sort.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MethodSortMatcher.Sort valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
isSort
protected abstract boolean isSort(MethodDescription target)
Determines if a method description is of the represented method sort.- Parameters:
target- A textual representation of the method sort that is represented by this instance.- Returns:
trueif the given method if of the method sort that is represented by this instance.
-
getDescription
protected java.lang.String getDescription()
Returns a textual representation of this instance's method sort.- Returns:
- A textual representation of this instance's method sort.
-
getMatcher
protected MethodSortMatcher<?> getMatcher()
Returns the predefined matcher for this method sort.- Returns:
- The predefined matcher for this method sort.
-
-