Class ResourceCapability


  • public class ResourceCapability
    extends Object
    A resource capability represents information about a particular device's capability. It has information about capability parameters related to the device.
    Author:
    hylli
    • Constructor Detail

      • ResourceCapability

        public ResourceCapability​(Capability capability)
        Create new ResourceCapability representing the given capability.
        Parameters:
        capability - capability for which this will have parameters
    • Method Detail

      • getCapability

        public Capability getCapability()
        Get the capability this has information for.
        Returns:
        the capability
      • addParameterObject

        public void addParameterObject​(String property,
                                       ParameterObjectValue value)
        Add a value for a parameter object.
        Parameters:
        property - property for which this is a value such as hasItemSize_max
        value - value for the parameter object
      • removeParameterObject

        public boolean removeParameterObject​(String property,
                                             ParameterObjectValue value)
        Remove the given ParameterObjectValue of the given property.
        Parameters:
        property - name of a property
        value - the value to be removed
        Returns:
        true if the property had the given value false otherwise
      • removeParameterObjectsFor

        public boolean removeParameterObjectsFor​(String property)
        Remove all ParameterObjectValues for the given property.
        Parameters:
        property - name of a property
        Returns:
        True if something was removed false if there were no values for this property
      • getParameterObjectProperties

        public Set<String> getParameterObjectProperties()
        Get all properties for which there are parameter object values.
        Returns:
        the properties
      • getParameterObjectValues

        public Set<ParameterObjectValue> getParameterObjectValues​(String property)
        Get parameter object values for the given property.
        Parameters:
        property - the property for example hasItemSize_min
        Returns:
        Parameter object values for example for item size
      • addParameterValue

        public void addParameterValue​(Parameter param,
                                      Object value)
        Add a value for the given capability parameter.
        Parameters:
        param - the parameter
        value - a value for the parameter
      • removeParameterValue

        public boolean removeParameterValue​(Parameter parameter)
        Removes all values for the given parameter.
        Parameters:
        parameter - parameter whose ParameterValue will be removed.
        Returns:
        True if there was a value false otherwise.
      • getParameters

        public Collection<ParameterValue> getParameters()
        Get all parameter values related to the capability.
        Returns:
        the parameter values
      • getParameterValueFor

        public ParameterValue getParameterValueFor​(Parameter parameter)
        Get a ParameterValue for the given Parameter.
        Parameters:
        parameter - a parameter
        Returns:
        value for the parameter. null if there is no value for the parameter.