Class Capability


  • public class Capability
    extends Object
    Represents a capability a device can have. A capability has a name and input and output associations. Input associations define what capabilities are required to form this capability as a combined capability. Output associations define what combined capabilities this capability together with other capabilities can form. Capability has also parameters: simple parameters like payload and more complex parameter objects for example item size.
    Author:
    hylli
    • Constructor Detail

      • Capability

        public Capability​(String name)
        Create a capability with the given name.
        Parameters:
        name - the capability name
    • Method Detail

      • getName

        public String getName()
        get the capability name
        Returns:
        the name
      • setName

        public void setName​(String name)
        set capability name
        Parameters:
        name - the name to set
      • getDescription

        public String getDescription()
        Get the capability's description text.
        Returns:
        the description
      • setDescription

        public void setDescription​(String description)
        Set the capability's description.
        Parameters:
        description - the description to set
      • setImplements

        public void setImplements​(ProcessTaxonomy process)
        Set a process taxonomy that this capability implements.
        Parameters:
        process - a process taxonomy that this capability implements
      • getImplements

        public ProcessTaxonomy getImplements()
        Get the process taxonomy that this capability implements if any.
        Returns:
        a process taxonomy, null if not exists.
      • getOutputs

        public Set<CapabilityAssociation> getOutputs()
        get the output capability associations
        Returns:
        the outputs
      • addOutputAssociation

        public void addOutputAssociation​(CapabilityAssociation association)
        add a new output capability association
        Parameters:
        association - the output association
      • addInputAssociation

        public void addInputAssociation​(CapabilityAssociation association)
        Add a new input association for the capability
        Parameters:
        association - the input association
      • isCombinedCapability

        public boolean isCombinedCapability()
        Tells if this capability is a combined capability ie.e it has input associations.
        Returns:
        is this a combined capability
      • getParameterAssociationsForParameters

        public Collection<ParameterAssociation<Parameter>> getParameterAssociationsForParameters()
        Get information about simple capability parameters such as payload associated with this capability. The association tells how many values for the parameter a device with the capability can have.
        Returns:
        parameter associations for simple parameters
      • getParameterAssociation

        public ParameterAssociation<Parameter> getParameterAssociation​(Parameter param)
        Get parameter association for the given parameter.
        Parameters:
        param - the parameter
        Returns:
        the parameter association. null if the capability doesn't have this capability parameter
      • getParameterAssociation

        public ParameterAssociation<ParameterObject> getParameterAssociation​(String property)
        Get parameter association for the given property.
        Parameters:
        property - the property for example hasItemSize
        Returns:
        the parameter association. null if there is no parameter for the given property
      • addParameterAssociationForParameter

        public void addParameterAssociationForParameter​(ParameterAssociation<Parameter> paramAssoc)
        Add a parameter association to the capability. The parameter association models the relationship between the capability and a capability parameter.
        Parameters:
        paramAssoc - the parameter association
      • addParameterAssociationForParameterObject

        public void addParameterAssociationForParameterObject​(String property,
                                                              ParameterAssociation<ParameterObject> paramAssoc)
        Add a parameter association for a object property.
        Parameters:
        property - the property for example hasItemSize
        paramAssoc - the association. for example to an ItemSize parameter object
      • getParameterObjectProperties

        public Set<String> getParameterObjectProperties()
        Get the different properties whose value is parameter association to a parameter object
        Returns:
        property names