Package net.solarnetwork.service
Class StaticOptionalServiceCollection<T>
java.lang.Object
net.solarnetwork.service.StaticOptionalServiceCollection<T>
- All Implemented Interfaces:
FilterableService,OptionalServiceCollection<T>,OptionalServiceCollection.OptionalFilterableServiceCollection<T>
public class StaticOptionalServiceCollection<T>
extends Object
implements OptionalServiceCollection.OptionalFilterableServiceCollection<T>
Implementation of
OptionalServiceCollection.OptionalFilterableServiceCollection using a
static collection of service instances.
This can be useful when the
OptionalServiceCollection.OptionalFilterableServiceCollection API is
required, but the service is known and available statically.
- Version:
- 1.1
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.service.OptionalServiceCollection
OptionalServiceCollection.OptionalFilterableServiceCollection<T> -
Constructor Summary
ConstructorsConstructorDescriptionStaticOptionalServiceCollection(Collection<T> services) Construct with the static services. -
Method Summary
Modifier and TypeMethodDescriptionGet the current map of property filters, with keys representing property names and value their desired associated value.Remove a property filter value.services()Get the collection of configured services.voidsetPropertyFilter(String key, Object value) Set a property filter value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.service.FilterableService
getPropertyValue
-
Constructor Details
-
StaticOptionalServiceCollection
Construct with the static services.- Parameters:
services- the services
-
-
Method Details
-
services
Description copied from interface:OptionalServiceCollectionGet the collection of configured services.- Specified by:
servicesin interfaceOptionalServiceCollection<T>- Returns:
- the services, never null but could be empty
-
getPropertyFilters
Description copied from interface:FilterableServiceGet the current map of property filters, with keys representing property names and value their desired associated value.- Specified by:
getPropertyFiltersin interfaceFilterableService- Returns:
- filters
-
setPropertyFilter
Description copied from interface:FilterableServiceSet a property filter value.- Specified by:
setPropertyFilterin interfaceFilterableService- Parameters:
key- the key to addvalue- the value
-
removePropertyFilter
Description copied from interface:FilterableServiceRemove a property filter value.- Specified by:
removePropertyFilterin interfaceFilterableService- Parameters:
key- the key to remove- Returns:
- the removed value, or null if no value was available
-