Class Hash
- java.lang.Object
-
- rocks.xmpp.extensions.hashes.model.Hash
-
- All Implemented Interfaces:
Hashed
public final class Hash extends Object implements Hashed
This class represents a hash value in conjunction with its algorithm.This class overrides
equals(java.lang.Object)andhashCode(), two instances equal each other, if their hash algorithm and value are equal.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static Hashfrom(Hashed hashed)StringgetHashAlgorithm()Gets the hash algorithm.byte[]getHashValue()Gets the hash value.inthashCode()StringtoString()
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
urn:xmpp:hashes:2- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Hash
public Hash(byte[] value, String algorithm)Creates hash value.- Parameters:
value- The hash value.algorithm- The hash algorithm.
-
-
Method Detail
-
getHashAlgorithm
public final String getHashAlgorithm()
Gets the hash algorithm.- Specified by:
getHashAlgorithmin interfaceHashed- Returns:
- The hash algorithm.
-
getHashValue
public final byte[] getHashValue()
Gets the hash value.- Specified by:
getHashValuein interfaceHashed- Returns:
- The hash value.
-
-