Package com.google.auto.common
Class SimpleAnnotationMirror
- java.lang.Object
-
- com.google.auto.common.SimpleAnnotationMirror
-
- All Implemented Interfaces:
javax.lang.model.element.AnnotationMirror
public final class SimpleAnnotationMirror extends java.lang.Object implements javax.lang.model.element.AnnotationMirror
A simple implementation of theAnnotationMirror
interface.This type implements
equals(Object)
andhashCode()
usingAnnotationMirrors.equivalence()
in accordance with theAnnotationMirror
spec. SomeAnnotationMirror
s, however, do not correctly implement equals, you should always compare them usingAnnotationMirrors.equivalence()
anyway.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.lang.model.element.TypeElement
annotationType
private com.google.common.collect.ImmutableMap<javax.lang.model.element.ExecutableElement,? extends javax.lang.model.element.AnnotationValue>
elementValues
private com.google.common.collect.ImmutableMap<java.lang.String,? extends javax.lang.model.element.AnnotationValue>
namedValues
-
Constructor Summary
Constructors Modifier Constructor Description private
SimpleAnnotationMirror(javax.lang.model.element.TypeElement annotationType, java.util.Map<java.lang.String,? extends javax.lang.model.element.AnnotationValue> namedValues)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
javax.lang.model.type.DeclaredType
getAnnotationType()
java.util.Map<javax.lang.model.element.ExecutableElement,? extends javax.lang.model.element.AnnotationValue>
getElementValues()
int
hashCode()
static javax.lang.model.element.AnnotationMirror
of(javax.lang.model.element.TypeElement annotationType)
An object representing an annotation instance.static javax.lang.model.element.AnnotationMirror
of(javax.lang.model.element.TypeElement annotationType, java.util.Map<java.lang.String,? extends javax.lang.model.element.AnnotationValue> namedValues)
An object representing an annotation instance.java.lang.String
toString()
-
-
-
Field Detail
-
annotationType
private final javax.lang.model.element.TypeElement annotationType
-
namedValues
private final com.google.common.collect.ImmutableMap<java.lang.String,? extends javax.lang.model.element.AnnotationValue> namedValues
-
elementValues
private final com.google.common.collect.ImmutableMap<javax.lang.model.element.ExecutableElement,? extends javax.lang.model.element.AnnotationValue> elementValues
-
-
Method Detail
-
of
public static javax.lang.model.element.AnnotationMirror of(javax.lang.model.element.TypeElement annotationType)
An object representing an annotation instance. IfannotationType
has any annotation members, they must have default values.
-
of
public static javax.lang.model.element.AnnotationMirror of(javax.lang.model.element.TypeElement annotationType, java.util.Map<java.lang.String,? extends javax.lang.model.element.AnnotationValue> namedValues)
An object representing an annotation instance. IfannotationType
has any annotation members, they must either be present innamedValues
or have default values.
-
getAnnotationType
public javax.lang.model.type.DeclaredType getAnnotationType()
- Specified by:
getAnnotationType
in interfacejavax.lang.model.element.AnnotationMirror
-
getElementValues
public java.util.Map<javax.lang.model.element.ExecutableElement,? extends javax.lang.model.element.AnnotationValue> getElementValues()
- Specified by:
getElementValues
in interfacejavax.lang.model.element.AnnotationMirror
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-