java.lang.Object
org.openehealth.ipf.commons.core.config.Lookup

public class Lookup extends Object
Lookup implementation of an interface type using ServiceLoader.
  • Constructor Details

    • Lookup

      public Lookup()
  • Method Details

    • lookup

      public static <T> Optional<T> lookup(Class<T> clazz)
      Returns the first implementation of T
      Type Parameters:
      T - interface type
      Parameters:
      clazz - interface
      Returns:
      first implementation of T, if any
    • lookupAll

      public static <T> Collection<? extends T> lookupAll(Class<T> clazz)
      Returns all implementations of T
      Type Parameters:
      T - interface type
      Parameters:
      clazz - interface
      Returns:
      implementations of T or an empty collection