Class HashElement
- java.lang.Object
-
- org.jivesoftware.smackx.hashes.element.HashElement
-
- All Implemented Interfaces:
Element,ExtensionElement,FullyQualifiedElement,NamedElement,XmlLangElement
public class HashElement extends java.lang.Object implements ExtensionElement
Represent a hash element.
-
-
Constructor Summary
Constructors Constructor Description HashElement(HashManager.ALGORITHM algorithm, byte[] hash)Create a HashElement from pre-calculated values.HashElement(HashManager.ALGORITHM algorithm, java.lang.String hashB64)Create a HashElement from pre-calculated values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)HashManager.ALGORITHMgetAlgorithm()Return the hash algorithm used in this HashElement.java.lang.StringgetElementName()Returns the root element name.byte[]getHash()Return the checksum as a byte array.java.lang.StringgetHashB64()Return the checksum as a base16 (hex) string.java.lang.StringgetNamespace()Returns the root element XML namespace.inthashCode()java.lang.CharSequencetoXML(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.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
ATTR_ALGO
public static final java.lang.String ATTR_ALGO
- See Also:
- Constant Field Values
-
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()
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceFullyQualifiedElement- Returns:
- the namespace.
-
toXML
public java.lang.CharSequence toXML(XmlEnvironment enclosingNamespace)
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-