public final class Hash extends java.lang.Object implements Hashed
This class represents a hash value in conjunction with its algorithm.
This class overrides equals(java.lang.Object) and hashCode(), two instances equal each other, if their hash algorithm and value are equal.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAMESPACE
urn:xmpp:hashes:2
|
| Constructor and Description |
|---|
Hash(byte[] value,
java.lang.String algorithm)
Creates hash value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static Hash |
from(Hashed hashed) |
java.lang.String |
getHashAlgorithm()
Gets the hash algorithm.
|
byte[] |
getHashValue()
Gets the hash value.
|
int |
hashCode() |
java.lang.String |
toString() |
public static final java.lang.String NAMESPACE
urn:xmpp:hashes:2
public Hash(byte[] value,
java.lang.String algorithm)
Creates hash value.
value - The hash value.algorithm - The hash algorithm.public final java.lang.String getHashAlgorithm()
Gets the hash algorithm.
getHashAlgorithm in interface Hashedpublic final byte[] getHashValue()
Gets the hash value.
getHashValue in interface Hashedpublic final boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic final java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2019 XMPP.rocks. All rights reserved.