public final class DefaultAnnotations extends java.lang.Object implements SparseAnnotations
Modifier and Type | Class and Description |
---|---|
static class |
DefaultAnnotations.Builder
Facility for gradually building model annotations.
|
Modifier and Type | Field and Description |
---|---|
static SparseAnnotations |
EMPTY |
Modifier and Type | Method and Description |
---|---|
java.util.HashMap<java.lang.String,java.lang.String> |
asMap()
Returns the annotations as a map.
|
static DefaultAnnotations.Builder |
builder()
Creates a new annotations builder.
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isRemoved(java.lang.String key)
Indicates whether the specified key has been tagged as removed.
|
java.util.Set<java.lang.String> |
keys()
Returns the set of keys for available annotations.
|
static DefaultAnnotations |
merge(DefaultAnnotations annotations,
SparseAnnotations sparseAnnotations)
Merges the specified base set of annotations and additional sparse
annotations into new combined annotations.
|
java.lang.String |
toString() |
static SparseAnnotations |
union(SparseAnnotations annotations,
SparseAnnotations sparseAnnotations)
Creates the union of two given SparseAnnotations.
|
java.lang.String |
value(java.lang.String key)
Returns the value of the specified annotation.
|
public static final SparseAnnotations EMPTY
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.HashMap<java.lang.String,java.lang.String> asMap()
public static DefaultAnnotations.Builder builder()
public static DefaultAnnotations merge(DefaultAnnotations annotations, SparseAnnotations sparseAnnotations)
annotations
- base annotationssparseAnnotations
- additional sparse annotationspublic static SparseAnnotations union(SparseAnnotations annotations, SparseAnnotations sparseAnnotations)
merge(DefaultAnnotations, SparseAnnotations)
method,
result will be SparseAnnotations
instead of Annotations
.
A key tagged for removal will remain in the output SparseAnnotations,
if the counterpart of the input does not contain the same key.annotations
- base annotationssparseAnnotations
- additional sparse annotationspublic java.util.Set<java.lang.String> keys()
SparseAnnotations
Note that this set includes keys for any attributes tagged for removal.
keys
in interface Annotations
keys
in interface SparseAnnotations
public java.lang.String value(java.lang.String key)
Annotations
value
in interface Annotations
key
- annotation keypublic boolean isRemoved(java.lang.String key)
SparseAnnotations
isRemoved
in interface SparseAnnotations
key
- annotation keypublic java.lang.String toString()
toString
in class java.lang.Object