Interface Lookup

All Superinterfaces:
Service
All Known Implementing Classes:
DefaultLookup, ProtoLookup

public interface Lookup extends Service
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    lookup(Class<T> type)
    Performs a lookup for given typed component.
    <T> T
    lookup(Class<T> type, String name)
    Performs a lookup for given typed component.
    <T> List<T>
    lookupList(Class<T> type)
    Performs a collection lookup for given typed components.
    <T> Map<String,T>
    lookupMap(Class<T> type)
    Performs a collection lookup for given typed components.
    <T> Optional<T>
    Performs a lookup for optional typed component.
    <T> Optional<T>
    lookupOptional(Class<T> type, String name)
    Performs a lookup for optional typed component.
  • Method Details

    • lookup

      @Nonnull <T> T lookup(Class<T> type)
      Performs a lookup for given typed component.
      Type Parameters:
      T - The component type.
      Parameters:
      type - The component type.
      Returns:
      The component.
      Throws:
      LookupException - if no such component or there is some provisioning related issue.
    • lookup

      @Nonnull <T> T lookup(Class<T> type, String name)
      Performs a lookup for given typed component.
      Type Parameters:
      T - The component type.
      Parameters:
      type - The component type.
      name - The component name.
      Returns:
      The component.
      Throws:
      LookupException - if no such component or there is some provisioning related issue.
    • lookupOptional

      @Nonnull <T> Optional<T> lookupOptional(Class<T> type)
      Performs a lookup for optional typed component.
      Type Parameters:
      T - The component type.
      Parameters:
      type - The component type.
      Returns:
      Optional carrying component or empty optional if no such component.
      Throws:
      LookupException - if there is some provisioning related issue.
    • lookupOptional

      @Nonnull <T> Optional<T> lookupOptional(Class<T> type, String name)
      Performs a lookup for optional typed component.
      Type Parameters:
      T - The component type.
      Parameters:
      type - The component type.
      name - The component name.
      Returns:
      Optional carrying component or empty optional if no such component.
      Throws:
      LookupException - if there is some provisioning related issue.
    • lookupList

      @Nonnull <T> List<T> lookupList(Class<T> type)
      Performs a collection lookup for given typed components.
      Type Parameters:
      T - The component type.
      Parameters:
      type - The component type.
      Returns:
      The list of components. The list may be empty if no components found.
      Throws:
      LookupException - if there is some provisioning related issue.
    • lookupMap

      @Nonnull <T> Map<String,T> lookupMap(Class<T> type)
      Performs a collection lookup for given typed components.
      Type Parameters:
      T - The component type.
      Parameters:
      type - The component type.
      Returns:
      The map of components. The map may be empty if no components found.
      Throws:
      LookupException - if there is some provisioning related issue.