Class Lookup.ObjectLookup

java.lang.Object
org.praxislive.core.Lookup.ObjectLookup
All Implemented Interfaces:
Lookup
Enclosing interface:
Lookup

public static class Lookup.ObjectLookup extends Object implements Lookup
  • Method Details

    • find

      public <T> Optional<T> find(Class<T> type)
      Description copied from interface: Lookup
      Search for the first implementation of the given type. Returns an Optional wrapping an instance of the given Class, or Optional.EMPTY if none exists.
      Specified by:
      find in interface Lookup
      Type Parameters:
      T - service type to lookup
      Parameters:
      type - class of service to lookup
      Returns:
      Optional wrapping first instance of type, or an empty Optional if not found
    • findAll

      public <T> Stream<T> findAll(Class<T> type)
      Description copied from interface: Lookup
      Search for all implementations of the given type.
      Specified by:
      findAll in interface Lookup
      Type Parameters:
      T - service type to lookup
      Parameters:
      type - class of service to lookup
      Returns:
      Stream of all implementations of the given type
    • create

      public static Lookup.ObjectLookup create(Object... instances)
    • create

      public static Lookup.ObjectLookup create(Lookup parent, Object... instances)