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>
AServiceDefinitionimplementation that uses aMethodHandles.Lookupobject to find a public constructor.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()booleanisPresent()Sload()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:
isPresentin interfaceServiceDefinition<S>- Returns:
- is the service present
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceServiceDefinition<S>- Returns:
- The full class name of the service
-
load
public S load()
- Specified by:
loadin interfaceServiceDefinition<S>- Returns:
- load the service
-
-