Interface Lookup<T>

Type Parameters:
T - Element type
All Known Implementing Classes:
CompatibilityLookup, IgnoreCaseLookup, LoadingCacheLookup, SnapshotLookup

public interface Lookup<T>
A case sensitive/insensitive lookup for tables, schemas, functions, types ...
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> Lookup<T>
    concat(Lookup<T>... lookups)
    Concat a list of lookups.
    static <T> Lookup<T>
    Returns an empty lookup.
    @Nullable T
    get(String name)
    Returns a named entity with a given name, or null if not found.
    static <T> @Nullable T
    get(Lookup<T> lookup, String name, boolean caseSensitive)
    Helper method to call Lookup.get(String) or Lookup.getIgnoreCase(String) depending on the parameter caseSensitive.
    @Nullable Named<T>
    Returns a named entity with a given name ignoring the case, or null if not found.
    Returns the names of the entities in matching pattern.
    default <S> Lookup<S>
    map(BiFunction<T,String,S> mapper)
     
    static <T> Lookup<T>
    of(NameMap<T> map)
    Creates a new lookup object based on a NameMap.
  • Method Details

    • get

      @Nullable T get(String name)
      Returns a named entity with a given name, or null if not found.
      Parameters:
      name - Name
      Returns:
      Entity with the specified name, or null when the entity is not found.
    • getIgnoreCase

      @Nullable Named<T> getIgnoreCase(String name)
      Returns a named entity with a given name ignoring the case, or null if not found.
      Parameters:
      name - Name
      Returns:
      Entity with the specified name (case insensitive), or null when the entity is not found.
    • getNames

      Set<String> getNames(LikePattern pattern)
      Returns the names of the entities in matching pattern. The search is always case sensitive. This is caused by the fact that DatabaseMetaData.getTables(...) doesn't support case insensitive lookups.
      Returns:
      The names of all entities matching the pattern.
    • map

      default <S> Lookup<S> map(BiFunction<T,String,S> mapper)
    • get

      static <T> @Nullable T get(Lookup<T> lookup, String name, boolean caseSensitive)
      Helper method to call Lookup.get(String) or Lookup.getIgnoreCase(String) depending on the parameter caseSensitive.
      Returns:
      Entity with the specified name, or null when the entity is not found.
    • empty

      static <T> Lookup<T> empty()
      Returns an empty lookup.
    • of

      static <T> Lookup<T> of(NameMap<T> map)
      Creates a new lookup object based on a NameMap.
    • concat

      static <T> Lookup<T> concat(Lookup<T>... lookups)
      Concat a list of lookups.