Class HashElement

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.ExtensionElement, org.jivesoftware.smack.packet.FullyQualifiedElement, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlLangElement

    public class HashElement
    extends java.lang.Object
    implements org.jivesoftware.smack.packet.ExtensionElement
    Represent a hash element.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ATTR_ALGO  
      static java.lang.String ELEMENT  
      static javax.xml.namespace.QName QNAME  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)  
      HashManager.ALGORITHM getAlgorithm()
      Return the hash algorithm used in this HashElement.
      java.lang.String getElementName()  
      byte[] getHash()
      Return the checksum as a byte array.
      java.lang.String getHashB64()
      Return the checksum as a base16 (hex) string.
      java.lang.String getNamespace()  
      int hashCode()  
      java.lang.CharSequence toXML​(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.jivesoftware.smack.packet.Element

        toXML, toXML
      • Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement

        getLanguage, getQName
    • Field Detail

      • QNAME

        public static final javax.xml.namespace.QName QNAME
    • Constructor Detail

      • HashElement

        public HashElement​(HashManager.ALGORITHM algorithm,
                           byte[] hash)
        Create a HashElement from pre-calculated values.
        Parameters:
        algorithm - The algorithm which was used.
        hash - the checksum as byte array.
      • HashElement

        public HashElement​(HashManager.ALGORITHM algorithm,
                           java.lang.String hashB64)
        Create a HashElement from pre-calculated values.
        Parameters:
        algorithm - the algorithm that was used.
        hashB64 - the checksum in base 64.
    • Method Detail

      • getAlgorithm

        public HashManager.ALGORITHM getAlgorithm()
        Return the hash algorithm used in this HashElement.
        Returns:
        algorithm the algorithm.
      • getHash

        public byte[] getHash()
        Return the checksum as a byte array.
        Returns:
        the hash.
      • getHashB64

        public java.lang.String getHashB64()
        Return the checksum as a base16 (hex) string.
        Returns:
        the hash.
      • getElementName

        public java.lang.String getElementName()
        Specified by:
        getElementName in interface org.jivesoftware.smack.packet.NamedElement
      • getNamespace

        public java.lang.String getNamespace()
        Specified by:
        getNamespace in interface org.jivesoftware.smack.packet.FullyQualifiedElement
      • toXML

        public java.lang.CharSequence toXML​(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
        Specified by:
        toXML in interface org.jivesoftware.smack.packet.Element
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object