Class Lookup.ObjectLookup

  • All Implemented Interfaces:
    Lookup
    Enclosing interface:
    Lookup

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

      • 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