Class MoreAnnotations
java.lang.Object
com.google.errorprone.util.MoreAnnotations
Annotation-related utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stream<AnnotationMirror> Converts the given annotation value to one or more annotations.asEnumValue(Class<T> clazz, AnnotationValue a) Converts the given attribute to an enum value.Converts the given attribute to an integer value.Converts the given annotation value to one or more strings.Converts the given attribute to an string value.static Stream<TypeMirror> Converts the given annotation value to one or more types.static Optional<TypeMirror> Converts the given attribute to a type.static Optional<AnnotationValue> getAnnotationValue(com.sun.tools.javac.code.Attribute.Compound attribute, String name) Returns the value of the annotation element-value pair with the given name if it is explicitly set.static Optional<com.sun.tools.javac.code.Attribute> Returns the value of the annotation element-value pair with the given name if it is explicitly set.
-
Method Details
-
getValue
-
getAnnotationValue
public static Optional<AnnotationValue> getAnnotationValue(com.sun.tools.javac.code.Attribute.Compound attribute, String name) Returns the value of the annotation element-value pair with the given name if it is explicitly set. -
asIntegerValue
Converts the given attribute to an integer value. -
asStringValue
Converts the given attribute to an string value. -
asEnumValue
Converts the given attribute to an enum value. -
asTypeValue
Converts the given attribute to a type. -
asStrings
Converts the given annotation value to one or more strings. -
asAnnotations
Converts the given annotation value to one or more annotations. -
asTypes
Converts the given annotation value to one or more types.
-