Interface SqlNameMatcher


public interface SqlNameMatcher
Checks whether two names are the same according to a case-sensitivity policy.
See Also:
  • Method Details

    • isCaseSensitive

      boolean isCaseSensitive()
      Returns whether name matching is case-sensitive.
    • matches

      boolean matches(String string, String name)
      Returns a name matches another.
      Parameters:
      string - Name written in code
      name - Name of object we are trying to match
      Returns:
      Whether matches
    • get

      <K extends List<String>, V> @Nullable V get(Map<K,V> map, List<String> prefixNames, List<String> names)
      Looks up an item in a map.
    • bestString

      String bestString()
      Returns the most recent match.

      In the default implementation, throws UnsupportedOperationException.

    • field

      @Nullable RelDataTypeField field(RelDataType rowType, String fieldName)
      Finds a field with a given name, using the current case-sensitivity, returning null if not found.
      Parameters:
      rowType - Row type
      fieldName - Field name
      Returns:
      Field, or null if not found
    • frequency

      int frequency(Iterable<String> names, String name)
      Returns how many times a string occurs in a collection.

      Similar to Collections.frequency(java.util.Collection<?>, java.lang.Object).

    • distinctCopy

      default List<String> distinctCopy(Iterable<String> names)
      Returns a copy of a collection, removing duplicates and retaining iteration order.
    • indexOf

      default int indexOf(Iterable<String> names, String name)
      Returns the index of the first element of a collection that matches.
    • createSet

      Set<String> createSet()
      Creates a set that has the same case-sensitivity as this matcher.