public final class AnnotationInstance extends Object
Thread-Safety
This class is immutable and can be shared between threads without safe publication.Modifier and Type | Method and Description |
---|---|
static AnnotationInstance |
create(DotName name,
AnnotationTarget target,
AnnotationValue[] values)
Construct a new mock annotation instance.
|
static AnnotationInstance |
create(DotName name,
AnnotationTarget target,
List<AnnotationValue> values)
Construct a new mock annotation instance.
|
boolean |
equals(Object o)
Returns whether or not this annotation instance is equivalent to another instance.
|
int |
hashCode()
Returns a hash code representing this object.
|
DotName |
name()
The name of this annotation in DotName form.
|
AnnotationTarget |
target()
The Java element that this annotation was declared on.
|
String |
toString()
Returns a string representation for this annotation instance.
|
String |
toString(boolean simple)
Returns an optionally simplified string that represents this annotation instance.
|
AnnotationValue |
value()
Returns the value that is associated with the special default "value"
parameter.
|
AnnotationValue |
value(String name)
Returns a value that corresponds with the specified parameter name.
|
List<AnnotationValue> |
values()
Returns a list of all parameter values on this annotation instance.
|
public static final AnnotationInstance create(DotName name, AnnotationTarget target, AnnotationValue[] values)
name
- the name of the annotation instancetarget
- the thing the annotation is declared onvalues
- the values of this annotation instancepublic static final AnnotationInstance create(DotName name, AnnotationTarget target, List<AnnotationValue> values)
name
- the name of the annotation instancetarget
- the thing the annotation is declared onvalues
- the values of this annotation instancepublic DotName name()
public AnnotationTarget target()
public AnnotationValue value(String name)
name
- the parameter namepublic AnnotationValue value()
public List<AnnotationValue> values()
public String toString(boolean simple)
simple
- whether to provide a simpler string representationpublic String toString()
toString(boolean)
with a value of true.public boolean equals(Object o)
AnnotationTarget
instance. The latter restriction
may be softened in future versions.equals
in class Object
o
- the annotation instance to compare to.Object.equals(Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
Copyright © 2018 JBoss by Red Hat. All rights reserved.