Package com.fasterxml.jackson.jaxrs.cfg
Class AnnotationBundleKey
- java.lang.Object
-
- com.fasterxml.jackson.jaxrs.cfg.AnnotationBundleKey
-
public final class AnnotationBundleKey extends java.lang.Object
Helper class used to allow efficient caching of information, given a sequence of Annotations. This is mostly used for reusing introspected information on JAX-RS end points.- Since:
- 2.2
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.annotation.Annotation[]
_annotations
private boolean
_annotationsCopied
private int
_hashCode
private java.lang.Class<?>
_type
We also seem to need the type as part of the key (as per [Issue#11]); hopefully that and annotations are enough (if not, may need to reconsider the way caching is done, and possibly only cache derivation of annotations, not mapper or reader/writer).private static java.lang.annotation.Annotation[]
NO_ANNOTATIONS
-
Constructor Summary
Constructors Modifier Constructor Description AnnotationBundleKey(java.lang.annotation.Annotation[] annotations, java.lang.Class<?> type)
private
AnnotationBundleKey(java.lang.annotation.Annotation[] annotations, java.lang.Class<?> type, int hashCode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_equals(java.lang.annotation.Annotation[] otherAnn)
private static int
calcHash(java.lang.annotation.Annotation[] annotations)
boolean
equals(java.lang.Object o)
int
hashCode()
AnnotationBundleKey
immutableKey()
Method called to create a safe immutable copy of the key; used when adding entry with this key -- lookups are ok without calling the method.java.lang.String
toString()
-
-
-
Field Detail
-
NO_ANNOTATIONS
private static final java.lang.annotation.Annotation[] NO_ANNOTATIONS
-
_annotations
private final java.lang.annotation.Annotation[] _annotations
-
_type
private final java.lang.Class<?> _type
We also seem to need the type as part of the key (as per [Issue#11]); hopefully that and annotations are enough (if not, may need to reconsider the way caching is done, and possibly only cache derivation of annotations, not mapper or reader/writer).
-
_annotationsCopied
private final boolean _annotationsCopied
-
_hashCode
private final int _hashCode
-
-
Method Detail
-
calcHash
private static final int calcHash(java.lang.annotation.Annotation[] annotations)
-
immutableKey
public AnnotationBundleKey immutableKey()
Method called to create a safe immutable copy of the key; used when adding entry with this key -- lookups are ok without calling the method.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
_equals
private final boolean _equals(java.lang.annotation.Annotation[] otherAnn)
-
-