public static final class BuildToolsServiceLoader.BuildToolServiceLoader
extends java.lang.Object
ServiceLoader helper.| Modifier and Type | Method and Description |
|---|---|
<T> java.util.ServiceLoader<T> |
getServiceLoader(BuildToolsServiceLoader.Service<T> serviceType)
Returns a newly allocated or existing
ServiceLoader instance for the passed
BuildToolsServiceLoader.Service type in the context
of the build-tools version this instance was created for. |
<T> java.util.Optional<T> |
getSingleService(com.android.utils.ILogger logger,
BuildToolsServiceLoader.Service<T> serviceType)
Return the first service instance for the requested service type or
Optional.empty() if none exist. |
@NonNull public <T> java.util.ServiceLoader<T> getServiceLoader(BuildToolsServiceLoader.Service<T> serviceType) throws java.lang.ClassNotFoundException
ServiceLoader instance for the passed
BuildToolsServiceLoader.Service type in the context
of the build-tools version this instance was created for.T - the type of serviceserviceType - the requested service type encapsulation.ServiceLoader instance for the T service type.java.lang.ClassNotFoundException@NonNull
public <T> java.util.Optional<T> getSingleService(com.android.utils.ILogger logger,
BuildToolsServiceLoader.Service<T> serviceType)
throws java.lang.ClassNotFoundException
Optional.empty() if none exist.T - the requested service class type.logger - to log resolution.serviceType - the requested service type encapsulation.java.lang.ClassNotFoundException