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
    Matches method descriptions that represent constructors, not methods or the type initializer.
    Matches method descriptions that represent Java 8 default methods.
    Matches method descriptions that represent methods, not constructors or the type initializer.
    Matches method descriptions that represent the type initializers.
    Matches method descriptions that are overridable.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    A textual representation of the method sort that is represented by this instance.
    private final MethodSortMatcher<?>
    A reusable matcher for this sort.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Sort(String description)
    Creates a new method sort representation.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    Returns a textual representation of this instance's method sort.
    protected MethodSortMatcher<?>
    Returns the predefined matcher for this method sort.
    protected abstract boolean
    Determines if a method description is of the represented method sort.
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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 type, in the order they are declared.
      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 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.