Enum MethodSortMatcher.Sort

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