Class EscapeCharacter

java.lang.Object
org.springframework.data.jpa.repository.query.EscapeCharacter

public final class EscapeCharacter extends Object
A value type encapsulating an escape character for LIKE queries and the actually usage of it in escaping Strings.
Author:
Jens Schauder, Oliver Drotbohm
  • Field Details

  • Method Details

    • of

      public static EscapeCharacter of(char escapeCharacter)
    • escape

      @Nullable public String escape(@Nullable String value)
      Escapes all special like characters (_, %) using the configured escape character.
      Parameters:
      value - may be null.
      Returns:
    • getEscapeCharacter

      public char getEscapeCharacter()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object