public final class Annotations extends Object
Annotation
.Modifier and Type | Method and Description |
---|---|
static Map<String,Object> |
getAttributes(Annotation annotation)
Returns a map of name-value pairs representing the attributes in the
specified annotation.
|
static String |
toSortedString(Annotation annotation)
Returns a
Object.toString() representation of annotation , with
its property names sorted alphabetically. |
static String |
toSortedString(Annotation annotation,
Comparator<String> comparator)
Returns a
Object.toString() representation of annotation , with
its property names sorted by comparator . |
public static Map<String,Object> getAttributes(Annotation annotation)
annotation
- The Annotation
whose attributes to get.NullPointerException
- If the specified annotation is null.public static String toSortedString(Annotation annotation)
Object.toString()
representation of annotation
, with
its property names sorted alphabetically.
This method is equivalent to calling:
toSortedString(annotation, null)
annotation
- The Annotation
.Object.toString()
representation of annotation
, with
its property names sorted by comparator
.NullPointerException
- If the specified annotation is null.public static String toSortedString(Annotation annotation, Comparator<String> comparator)
Object.toString()
representation of annotation
, with
its property names sorted by comparator
.annotation
- The Annotation
.comparator
- The Comparator
.Object.toString()
representation of annotation
, with
its property names sorted by comparator
.NullPointerException
- If the specified annotation is null.Copyright © 2020 LibJ. All rights reserved.