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 boolean
equals(Object o)
static Hash
from(Hashed hashed)
String
getHashAlgorithm()
Gets the hash algorithm.byte[]
getHashValue()
Gets the hash value.int
hashCode()
String
toString()
-
-
-
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:
getHashAlgorithm
in interfaceHashed
- Returns:
- The hash algorithm.
-
getHashValue
public final byte[] getHashValue()
Gets the hash value.- Specified by:
getHashValue
in interfaceHashed
- Returns:
- The hash value.
-
-