public final class ClassKey extends java.lang.Object implements java.lang.Comparable<ClassKey>, java.io.Serializable
JsonSerializer
s.
The reason for having a separate key class instead of
directly using Class
as key is mostly
to allow for redefining hashCode
method --
for some strange reason, Class
does not
redefine Object.hashCode()
and thus uses identity
hash, which is pretty slow. This makes key access using
Class
unnecessarily slow.
Note: since class is not strictly immutable, caller must know what it is doing, if changing field values.
Constructor and Description |
---|
ClassKey() |
ClassKey(java.lang.Class<?> clz) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ClassKey other) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
void |
reset(java.lang.Class<?> clz) |
java.lang.String |
toString() |
public void reset(java.lang.Class<?> clz)
public int compareTo(ClassKey other)
compareTo
in interface java.lang.Comparable<ClassKey>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved