Class MD5Template
java.lang.Object
org.jpos.space.MD5Template
- All Implemented Interfaces:
Serializable, Template
Space
Template that compares entries by an MD5 digest of their
serialized form rather than by reference equality.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMD5Template(Object key, byte[] digest) Constructs a template directly from a precomputed digest.MD5Template(Object key, Object value) Constructs a template that matches entries whose serialized form digests tovalue. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Computes the MD5 digest ofobj's serialized form.booleanIndicates whether the candidateobjmatches this template.byte[]Returns the digest used for comparison.Returns the digest as a hex-encoded string.getKey()Returns the key this template is registered under.inthashCode()static byte[]SerializesobjviaObjectOutputStream, returning the resulting bytes.toString()
-
Constructor Details
-
MD5Template
Constructs a template that matches entries whose serialized form digests tovalue.- Parameters:
key- entry keyvalue- reference value to digest
-
MD5Template
Constructs a template directly from a precomputed digest.- Parameters:
key- entry keydigest- precomputed MD5 digest
-
-
Method Details
-
digest
-
equals
-
hashCode
-
getKey
-
getDigest
-
getDigestAsString
Returns the digest as a hex-encoded string.- Returns:
- the digest hex string
-
toString
-
serialize
SerializesobjviaObjectOutputStream, returning the resulting bytes.- Parameters:
obj- object to serialize- Returns:
- the serialized byte array
- Throws:
IOException- if writing fails
-