Enum StringMatcher.Mode

java.lang.Object
java.lang.Enum<StringMatcher.Mode>
net.bytebuddy.matcher.StringMatcher.Mode
All Implemented Interfaces:
Serializable, Comparable<StringMatcher.Mode>, java.lang.constant.Constable
Enclosing class:
StringMatcher

public static enum StringMatcher.Mode extends Enum<StringMatcher.Mode>
Defines the mode a StringMatcher compares to strings with.
  • Enum Constant Details

    • EQUALS_FULLY

      public static final StringMatcher.Mode EQUALS_FULLY
      Checks if two strings equal and respects casing differences.
    • EQUALS_FULLY_IGNORE_CASE

      public static final StringMatcher.Mode EQUALS_FULLY_IGNORE_CASE
      Checks if two strings equal without respecting casing differences.
    • STARTS_WITH

      public static final StringMatcher.Mode STARTS_WITH
      Checks if a string starts with the a second string with respecting casing differences.
    • STARTS_WITH_IGNORE_CASE

      public static final StringMatcher.Mode STARTS_WITH_IGNORE_CASE
      Checks if a string starts with a second string without respecting casing differences.
    • ENDS_WITH

      public static final StringMatcher.Mode ENDS_WITH
      Checks if a string ends with a second string with respecting casing differences.
    • ENDS_WITH_IGNORE_CASE

      public static final StringMatcher.Mode ENDS_WITH_IGNORE_CASE
      Checks if a string ends with a second string without respecting casing differences.
    • CONTAINS

      public static final StringMatcher.Mode CONTAINS
      Checks if a string contains another string with respecting casing differences.
    • CONTAINS_IGNORE_CASE

      public static final StringMatcher.Mode CONTAINS_IGNORE_CASE
      Checks if a string contains another string without respecting casing differences.
    • MATCHES

      public static final StringMatcher.Mode MATCHES
      Checks if a string can be matched by a regular expression.
  • Field Details

    • description

      private final String description
      A description of the string for providing meaningful Object.toString() implementations for method matchers that rely on a match mode.
  • Constructor Details

    • Mode

      private Mode(String description)
      Creates a new match mode.
      Parameters:
      description - The description of this mode for providing meaningful Object.toString() implementations.
  • Method Details

    • values

      public static StringMatcher.Mode[] 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 StringMatcher.Mode 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
    • getDescription

      protected String getDescription()
      Returns the description of this match mode.
      Returns:
      The description of this match mode.
    • matches

      protected abstract boolean matches(String expected, String actual)
      Matches a string against another string.
      Parameters:
      expected - The target of the comparison against which the actual string is compared.
      actual - The source which is subject of the comparison to the expected value.
      Returns:
      true if the source matches the target.