Class MatchMode

java.lang.Object
com.aquima.interactions.foundation.MatchMode
All Implemented Interfaces:
Serializable

public final class MatchMode extends Object implements Serializable
Represents the match mode used in LIKE conditions in queries.
Since:
9.6
Author:
Petru Galanton
See Also:
  • Field Details

    • EXACT

      public static final MatchMode EXACT
      Match mode for conditions of the form name LIKE 'value'
    • START

      public static final MatchMode START
      Match mode for conditions of the form name like 'value%'
    • END

      public static final MatchMode END
      Match mode for conditions of the form name like '%value'
    • ANYWHERE

      public static final MatchMode ANYWHERE
      Match mode for conditions of the form name like '%value%'
  • Method Details

    • valueOf

      public static final MatchMode valueOf(String mode)
      Returns the match mode instance fir the given name.
      Parameters:
      mode - the match mode
      Returns:
      the corresponding MatchMode instance
      Throws:
      IllegalArgumentException - if no match mode exists with the given name
    • values

      public static final MatchMode[] values()
      Returns:
      all possible MatchMode values
    • getMode

      public String getMode()
      Returns:
      The string representation of this MatchMode.
    • apply

      public boolean apply(String tested, String filter)
      Applies this match mode to the given tested string. Depending on which MatchMode this is, this method returns true if the tested string starts with, ends with, contains or equals the filter string.

      A null test string doesn't match any filter, and no test string matches against a null filter. In particular, a null test string doesn't match against a null filter. If any of the parameters are null, this method returns false.

      Parameters:
      tested - the tested string
      filter - the filter string
      Returns:
      true if tested matches filter according to the rules of this match mode
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object