Package net.solarnetwork.service
Class FallbackOptionalService<T>
java.lang.Object
net.solarnetwork.service.FallbackOptionalService<T>
- Type Parameters:
T- the service type
- All Implemented Interfaces:
OptionalService<T>
Implementation of
OptionalService using a collection of delegate
optional services, returning the first available service when asked.
This can be useful when the an optional service should be used in preference to a completely independently configured default service.
- Since:
- 1.59
- Version:
- 1.0
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.service.OptionalService
OptionalService.OptionalFilterableService<T> -
Constructor Summary
ConstructorsConstructorDescriptionFallbackOptionalService(Collection<OptionalService<T>> services) Constructor. -
Method Summary
-
Constructor Details
-
FallbackOptionalService
Constructor.- Parameters:
services- the services to use
-
-
Method Details
-
service
Description copied from interface:OptionalServiceGet the configured service, or null if none available.- Specified by:
servicein interfaceOptionalService<T>- Returns:
- the service, or null
-