Package net.bytebuddy.matcher
Enum MethodSortMatcher.Sort
- java.lang.Object
-
- java.lang.Enum<MethodSortMatcher.Sort>
-
- net.bytebuddy.matcher.MethodSortMatcher.Sort
-
- All Implemented Interfaces:
Serializable
,Comparable<MethodSortMatcher.Sort>
- Enclosing class:
- MethodSortMatcher<T extends MethodDescription>
public static enum MethodSortMatcher.Sort extends Enum<MethodSortMatcher.Sort>
Represents a specific characteristic of a method description.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONSTRUCTOR
Matches method descriptions that represent constructors, not methods or the type initializer.DEFAULT_METHOD
Matches method descriptions that represent Java 8 default methods.METHOD
Matches method descriptions that represent methods, not constructors or the type initializer.TYPE_INITIALIZER
Matches method descriptions that represent the type initializers.VIRTUAL
Matches method descriptions that are overridable.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
getDescription()
Returns a textual representation of this instance's method sort.protected abstract boolean
isSort(MethodDescription target)
Determines if a method description is of the represented method sort.static MethodSortMatcher.Sort
valueOf(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.
-
-
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(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- 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:
true
if the given method if of the method sort that is represented by this instance.
-
getDescription
protected String getDescription()
Returns a textual representation of this instance's method sort.- Returns:
- A textual representation of this instance's method sort.
-
-