K
- the type of this safe key.@Immutable public abstract class AbstractKey<K extends AbstractKey<K>> extends Object implements Key<K>, Serializable
Subclasses need to be serializable with Object(Out|In)putStream
and
XML(En|De)coder
.
Subclasses do not need to be safe for multi-threading.
Constructor and Description |
---|
AbstractKey() |
Modifier and Type | Method and Description |
---|---|
K |
clone()
Returns a deep clone of this safe key.
|
boolean |
equals(Object obj)
Returns
true if and only if this safe key deeply equals the
given object. |
abstract int |
hashCode()
Returns a hash code which is consistent with
Key.equals(Object) . |
public K clone()
Key
public boolean equals(@Nullable Object obj)
Key
true
if and only if this safe key deeply equals the
given object.
A safe key equals another object if and only if the other object
has the same runtime class and all its properties compare deeply equal.public abstract int hashCode()
Key
Key.equals(Object)
.
This method is provided for completeness only - you should actually
never use secret keys as hash map keys because of their mutable
properties!Copyright © 2012–2018 Schlichtherle IT Services. All rights reserved.