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 Details

    • getPropertyFilters

      Map<String,?> getPropertyFilters()
      Get the current map of property filters, with keys representing property names and value their desired associated value.
      Returns:
      filters
    • setPropertyFilter

      void setPropertyFilter(String key, Object value)
      Set a property filter value.
      Parameters:
      key - the key to add
      value - the value
    • removePropertyFilter

      Object removePropertyFilter(String key)
      Remove a property filter value.
      Parameters:
      key - the key to remove
      Returns:
      the removed value, or null if no value was available
    • getPropertyValue

      default <T> T getPropertyValue(String key)
      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

      static <T> T filterPropValue(OptionalService<?> optionalService, String key)
      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 null
      key - the desired filter property key
      Returns:
      the filter property value, or null
      Since:
      1.1
    • filterPropValue

      static <T> T filterPropValue(FilterableService service, String key)
      Get a filter property value.
      Type Parameters:
      T - the filter property type
      Parameters:
      service - the filterable service, or null
      key - the desired filter property key
      Returns:
      the filter property value, or null
      Since:
      1.1
    • setFilterProp

      static void setFilterProp(OptionalService<?> optionalService, String key, Object value)
      Set a filter property value on an optional service that is also optional.
      Parameters:
      optionalService - the optional service, or null
      key - the desired filter property key
      value - the filter property value to set
      Since:
      1.1
    • setFilterProp

      static void setFilterProp(FilterableService service, String key, Object value)
      Set a filter property value.
      Parameters:
      service - the filterable service, or null
      key - the filter property key
      value - the filter property value to set
      Since:
      1.1