Package net.solarnetwork.service
Interface FilterableService
- All Known Subinterfaces:
OptionalService.OptionalFilterableService<T>,OptionalServiceCollection.OptionalFilterableServiceCollection<T>
- All Known Implementing Classes:
StaticOptionalService,StaticOptionalServiceCollection
public interface FilterableService
API for a service that supports filtering properties, to support narrowing
down a possible collection of services to one or more specific services
matching the filter.
- Version:
- 1.2
- Author:
- matt
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TfilterPropValue(FilterableService service, String key) Get a filter property value.static <T> TfilterPropValue(OptionalService<?> optionalService, String key) Get a filter property value from an optional service that is also optional.Get the current map of property filters, with keys representing property names and value their desired associated value.default <T> TgetPropertyValue(String key) Get a property filter value.Remove a property filter value.static voidsetFilterProp(FilterableService service, String key, Object value) Set a filter property value.static voidsetFilterProp(OptionalService<?> optionalService, String key, Object value) Set a filter property value on an optional service that is also optional.voidsetPropertyFilter(String key, Object value) Set a property filter value.
-
Method Details
-
getPropertyFilters
Get the current map of property filters, with keys representing property names and value their desired associated value.- Returns:
- filters
-
setPropertyFilter
Set a property filter value.- Parameters:
key- the key to addvalue- the value
-
removePropertyFilter
Remove a property filter value.- Parameters:
key- the key to remove- Returns:
- the removed value, or null if no value was available
-
getPropertyValue
Get a property filter value.- Type Parameters:
T- the expected property value type- Parameters:
key- the property filter key to get the value for- Returns:
- the property value, or null if not available
- Since:
- 1.2
-
filterPropValue
Get a filter property value from an optional service that is also optional.- Type Parameters:
T- the filter property type- Parameters:
optionalService- the optional service, or nullkey- the desired filter property key- Returns:
- the filter property value, or null
- Since:
- 1.1
-
filterPropValue
Get a filter property value.- Type Parameters:
T- the filter property type- Parameters:
service- the filterable service, or nullkey- the desired filter property key- Returns:
- the filter property value, or null
- Since:
- 1.1
-
setFilterProp
Set a filter property value on an optional service that is also optional.- Parameters:
optionalService- the optional service, or nullkey- the desired filter property keyvalue- the filter property value to set- Since:
- 1.1
-
setFilterProp
Set a filter property value.- Parameters:
service- the filterable service, or nullkey- the filter property keyvalue- the filter property value to set- Since:
- 1.1
-