Package io.micronaut.core.io.service
Class SoftServiceLoader.StaticDefinition<S>
- java.lang.Object
-
- io.micronaut.core.io.service.SoftServiceLoader.StaticDefinition<S>
-
- Type Parameters:
S
- The service type
- All Implemented Interfaces:
ServiceDefinition<S>
- Enclosing class:
- SoftServiceLoader<S>
public static final class SoftServiceLoader.StaticDefinition<S> extends java.lang.Object implements ServiceDefinition<S>
AServiceDefinition
implementation that uses aMethodHandles.Lookup
object to find a public constructor.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
boolean
isPresent()
S
load()
static <S> SoftServiceLoader.StaticDefinition<S>
of(java.lang.String name, java.lang.Class<S> value)
static <S> SoftServiceLoader.StaticDefinition<S>
of(java.lang.String name, java.util.function.Supplier<S> value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.core.io.service.ServiceDefinition
orElseThrow
-
-
-
-
Method Detail
-
of
public static <S> SoftServiceLoader.StaticDefinition<S> of(java.lang.String name, java.lang.Class<S> value)
-
of
public static <S> SoftServiceLoader.StaticDefinition<S> of(java.lang.String name, java.util.function.Supplier<S> value)
-
isPresent
public boolean isPresent()
- Specified by:
isPresent
in interfaceServiceDefinition<S>
- Returns:
- is the service present
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceServiceDefinition<S>
- Returns:
- The full class name of the service
-
load
public S load()
- Specified by:
load
in interfaceServiceDefinition<S>
- Returns:
- load the service
-
-