- All Implemented Interfaces:
Lookup
- Enclosing interface:
Lookup
public static class Lookup.Empty
extends Object
implements Lookup
-
-
-
Constructor Summary
Constructors
-
Method Summary
Search for the first implementation of the given type.
Search for all implementations of the given type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Details
-
find
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
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