Class ResourceCapability
- java.lang.Object
-
- fi.tut.mei.capabilityQueryLib.model.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 Summary
Constructors Constructor Description ResourceCapability(Capability capability)
Create new ResourceCapability representing the given capability.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameterObject(String property, ParameterObjectValue value)
Add a value for a parameter object.void
addParameterValue(Parameter param, Object value)
Add a value for the given capability parameter.Capability
getCapability()
Get the capability this has information for.Set<String>
getParameterObjectProperties()
Get all properties for which there are parameter object values.Set<ParameterObjectValue>
getParameterObjectValues(String property)
Get parameter object values for the given property.Collection<ParameterValue>
getParameters()
Get all parameter values related to the capability.ParameterValue
getParameterValueFor(Parameter parameter)
Get a ParameterValue for the given Parameter.boolean
removeParameterObject(String property, ParameterObjectValue value)
Remove the given ParameterObjectValue of the given property.boolean
removeParameterObjectsFor(String property)
Remove all ParameterObjectValues for the given property.boolean
removeParameterValue(Parameter parameter)
Removes all values for the given parameter.
-
-
-
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_maxvalue
- 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 propertyvalue
- 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 parametervalue
- 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.
-
-