Class BodyQName

java.lang.Object
org.igniterealtime.jbosh.BodyQName

public final class BodyQName extends Object
Qualified name of an attribute of the wrapper element. This class is analagous to the javax.xml.namespace.QName class. Each qualified name consists of a namespace URI and a local name.

Instances of this class are immutable and thread-safe.

  • Field Details

  • Constructor Details

    • BodyQName

      private BodyQName(QName wrapped)
      Private constructor to prevent direct construction.
      Parameters:
      wrapped - QName instance to wrap
  • Method Details

    • create

      public static BodyQName create(String uri, String local)
      Creates a new qualified name using a namespace URI and local name.
      Parameters:
      uri - namespace URI
      local - local name
      Returns:
      BodyQName instance
    • createWithPrefix

      public static BodyQName createWithPrefix(String uri, String local, String prefix)
      Creates a new qualified name using a namespace URI and local name along with an optional prefix.
      Parameters:
      uri - namespace URI
      local - local name
      prefix - optional prefix or @{code null} for no prefix
      Returns:
      BodyQName instance
    • getNamespaceURI

      public String getNamespaceURI()
      Get the namespace URI of this qualified name.
      Returns:
      namespace uri
    • getLocalPart

      public String getLocalPart()
      Get the local part of this qualified name.
      Returns:
      local name
    • getPrefix

      public String getPrefix()
      Get the optional prefix used with this qualified name, or null if no prefix has been assiciated.
      Returns:
      prefix, or null if no prefix was supplied
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      static BodyQName createBOSH(String local)
      Creates a new qualified name using the BOSH namespace URI and local name.
      Parameters:
      local - local name
      Returns:
      BodyQName instance
    • equalsQName

      boolean equalsQName(QName otherName)
      Convenience method to compare this qualified name with a javax.xml.namespace.QName.
      Parameters:
      otherName - QName to compare to
      Returns:
      @{code true} if the qualified name is the same, false otherwise