Class QualifiedName


  • public final class QualifiedName
    extends Object
    Qualified names are two-part names: qualifier and local name. The qualifier must be in URI form (see RFC2396). Note however that the qualifier may be null if the default name space is being used. The empty string is not a valid local name.

    This class can be used without OSGi running.

    This class is not intended to be subclassed by clients.

    • Constructor Detail

      • QualifiedName

        public QualifiedName​(String qualifier,
                             String localName)
        Creates and returns a new qualified name with the given qualifier and local name. The local name must not be the empty string. The qualifier may be null.

        Clients may instantiate.

        Parameters:
        qualifier - the qualifier string, or null
        localName - the local name string
    • Method Detail

      • equals

        public boolean equals​(Object obj)
        Returns whether this qualified name is equivalent to the given object.

        Qualified names are equal if and only if they have the same qualified parts and local parts. Qualified names are not equal to objects other than qualified names.

        Overrides:
        equals in class Object
        Parameters:
        obj - the object to compare to
        Returns:
        true if these are equivalent qualified names, and false otherwise
      • getLocalName

        public String getLocalName()
        Returns the local part of this name.
        Returns:
        the local name string
      • getQualifier

        public String getQualifier()
        Returns the qualifier part for this qualified name, or null if none.
        Returns:
        the qualifier string, or null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Converts this qualified name into a string, suitable for debug purposes only.
        Overrides:
        toString in class Object