Package com.fasterxml.jackson.jr.ob.impl
Class ClassKey
- java.lang.Object
-
- com.fasterxml.jackson.jr.ob.impl.ClassKey
-
public final class ClassKey extends java.lang.Object
Key class, used as an efficient and accurate key for locating per-class values fromMap
s.The reason for having a separate key class instead of directly using
Class
as key is mostly to allow for redefininghashCode
method -- for some strange reason,Class
does not redefineObject.hashCode()
and thus uses identity hash, which is pretty slow. This makes key access usingClass
unnecessarily slow.Note: since class is not strictly immutable, caller must know what it is doing, if changing field values.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.String
toString()
ClassKey
with(java.lang.Class<?> clz, int flags)
-
-
-
Method Detail
-
with
public ClassKey with(java.lang.Class<?> clz, int flags)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-