Package st.orm

Record Class Match.WordStart<T extends Data>

java.lang.Object
java.lang.Record
st.orm.Match.WordStart<T>
Type Parameters:
T - the root table type of the column.
Record Components:
path - the text column.
minLength - the shortest word, in characters, by which the column takes the words in its form.
fallback - the match of the whole input while no word reaches the length, or null for none; its own fallback takes no part.
All Implemented Interfaces:
Match<T>
Enclosing interface:
Match<T extends Data>

public static record Match.WordStart<T extends Data>(Metamodel<T extends Data,String> path, int minLength, @Nullable Match<T extends Data> fallback) extends Record implements Match<T>
A word matches at the start of any word in the value: the value's start, or the text after a space or one of the punctuation characters that join or separate the words of a name, a hyphen, an apostrophe, an opening parenthesis, a slash, a colon, a period or a comma, so marie matches "Anne-Marie" and brien "O'Brien". It renders as LOWER(column) LIKE LOWER('word%') and one LOWER(column) LIKE LOWER('% word%') per separator, or as the one regular expression a database matches, and finds the same rows on every database.
  • Constructor Details

    • WordStart

      public WordStart(Metamodel<T,String> path, int minLength, @Nullable Match<T> fallback)
      Creates an instance of a WordStart record class.
      Parameters:
      path - the value for the path record component
      minLength - the value for the minLength record component
      fallback - the value for the fallback record component
    • WordStart

      public WordStart(Metamodel<T,String> path, int minLength)
      A match with the default fallback, the start of the value, ignoring case.
      Parameters:
      path - the text column.
      minLength - the shortest word, in characters, by which the column takes the words in its form.
    • WordStart

      public WordStart(Metamodel<T,String> path)
      A match of the default length, 3<T extends Data> characters, with the default fallback.
      Parameters:
      path - the text column.
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • path

      public Metamodel<T,String> path()
      Returns the value of the path record component.
      Specified by:
      path in interface Match<T extends Data>
      Returns:
      the value of the path record component
    • minLength

      public int minLength()
      Returns the value of the minLength record component.
      Specified by:
      minLength in interface Match<T extends Data>
      Returns:
      the value of the minLength record component
    • fallback

      public @Nullable Match<T> fallback()
      Returns the value of the fallback record component.
      Specified by:
      fallback in interface Match<T extends Data>
      Returns:
      the value of the fallback record component