Enum Class MethodSortMatcher.Sort

java.lang.Object
java.lang.Enum<MethodSortMatcher.Sort>
net.bytebuddy.matcher.MethodSortMatcher.Sort
All Implemented Interfaces:
Serializable, Comparable<MethodSortMatcher.Sort>, Constable
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 Details

    • 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 Details

    • description

      private final 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.
  • Constructor Details

    • Sort

      private Sort(String description)
      Creates a new method sort representation.
      Parameters:
      description - A textual representation of the method sort that is represented by this instance.
  • Method Details

    • values

      public static MethodSortMatcher.Sort[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MethodSortMatcher.Sort valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      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:
      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.
    • getMatcher

      protected MethodSortMatcher<?> getMatcher()
      Returns the predefined matcher for this method sort.
      Returns:
      The predefined matcher for this method sort.