Class OSGiRequirementAdapter

  • All Implemented Interfaces:
    Requirement

    class OSGiRequirementAdapter
    extends java.lang.Object
    implements Requirement
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.HashMap<java.lang.String,​java.lang.String> cleanedDirectives  
      private java.lang.String filter  
      private org.osgi.resource.Requirement requirement  
    • Constructor Summary

      Constructors 
      Constructor Description
      OSGiRequirementAdapter​(org.osgi.resource.Requirement requirement)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
      Return a map of attributes.
      java.lang.String getComment()  
      java.util.Map<java.lang.String,​java.lang.String> getDirectives()
      Return the map of directives for this requirement.
      java.lang.String getFilter()
      Return the filter.
      java.lang.String getName()
      Return the name of the requirement.
      boolean isExtend()  
      boolean isMultiple()  
      boolean isOptional()  
      boolean isSatisfied​(Capability capability)
      Check if the given capability satisfied this requirement.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • requirement

        private final org.osgi.resource.Requirement requirement
      • cleanedDirectives

        private final java.util.HashMap<java.lang.String,​java.lang.String> cleanedDirectives
      • filter

        private final java.lang.String filter
    • Constructor Detail

      • OSGiRequirementAdapter

        public OSGiRequirementAdapter​(org.osgi.resource.Requirement requirement)
    • Method Detail

      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
        Description copied from interface: Requirement
        Return a map of attributes. Requirements can have attributes, but these are not used for matching. They are for informational purposes only.
        Specified by:
        getAttributes in interface Requirement
        Returns:
        The map of attributes.
      • getDirectives

        public java.util.Map<java.lang.String,​java.lang.String> getDirectives()
        Description copied from interface: Requirement
        Return the map of directives for this requirement. This requirements map does *not* contain requirements that are modeled via direct APIs on this interface, such as the filter, cardinality and resolution.
        Specified by:
        getDirectives in interface Requirement
        Returns:
      • getFilter

        public java.lang.String getFilter()
        Description copied from interface: Requirement
        Return the filter.
        Specified by:
        getFilter in interface Requirement
      • getName

        public java.lang.String getName()
        Description copied from interface: Requirement
        Return the name of the requirement.
        Specified by:
        getName in interface Requirement
      • isSatisfied

        public boolean isSatisfied​(Capability capability)
        Description copied from interface: Requirement
        Check if the given capability satisfied this requirement.
        Specified by:
        isSatisfied in interface Requirement
        Parameters:
        capability - the capability to check
        Returns:
        true is the capability satisfies this requirement, false otherwise