Interface Capability

  • All Known Subinterfaces:
    BundleCapability, HostedCapability
    All Known Implementing Classes:
    BundleCapabilityImpl, WrappedCapability

    @ConsumerType
    public interface Capability
    A capability that has been declared from a Resource.

    Instances of this type must be effectively immutable. That is, for a given instance of this interface, the methods defined by this interface must always return the same result.

    Author:
    $Id: e79d11402e14e170443c8a2a9da835391cd1ccc8 $
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Compares this Capability to another Capability.
      java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
      Returns the attributes of this capability.
      java.util.Map<java.lang.String,​java.lang.String> getDirectives()
      Returns the directives of this capability.
      java.lang.String getNamespace()
      Returns the namespace of this capability.
      Resource getResource()
      Returns the resource declaring this capability.
      int hashCode()
      Returns the hashCode of this Capability.
    • Method Detail

      • getNamespace

        java.lang.String getNamespace()
        Returns the namespace of this capability.
        Returns:
        The namespace of this capability.
      • getDirectives

        java.util.Map<java.lang.String,​java.lang.String> getDirectives()
        Returns the directives of this capability.
        Returns:
        An unmodifiable map of directive names to directive values for this capability, or an empty map if this capability has no directives.
      • getAttributes

        java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
        Returns the attributes of this capability.
        Returns:
        An unmodifiable map of attribute names to attribute values for this capability, or an empty map if this capability has no attributes.
      • getResource

        Resource getResource()
        Returns the resource declaring this capability.
        Returns:
        The resource declaring this capability.
      • equals

        boolean equals​(java.lang.Object obj)
        Compares this Capability to another Capability.

        This Capability is equal to another Capability if they have the same namespace, directives and attributes and are declared by the same resource.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The object to compare against this Capability.
        Returns:
        true if this Capability is equal to the other object; false otherwise.
      • hashCode

        int hashCode()
        Returns the hashCode of this Capability.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hashCode of this Capability.