public class Annotations extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
annotations |
Constructor and Description |
---|
Annotations(Span span) |
Modifier and Type | Method and Description |
---|---|
Object |
get(String key) |
Boolean |
getBoolean(String key)
Helper function to get a Boolean annotation.
|
Double |
getDouble(String key)
Helper function to get a Double annotation.
|
Integer |
getInteger(String key)
Helper function to get a Double annotation.
|
Map<String,Object> |
getMap() |
Span |
getSpan()
The span that this annotation is for.
|
String |
getString(String key)
Helper function to get a String from the Annotation.
|
String |
getSubString()
The text this annotation is for.
|
void |
put(String key,
Object o)
Adds an annotation to the the the set of annotations.
|
public Annotations(Span span)
public Span getSpan()
public String getSubString()
public Double getDouble(String key)
This function first checks if the Object in a map is a Number
, and then calls doubleValue() on it
If it is not, then Double.parseDouble() is called on the string representation of the object. If the string
is not parseable as a double, a NumberFormatException is thrown.
public String getString(String key)
toString()
on the
object saved in the Annotation or return null if the object is null;public Integer getInteger(String key)
This function first checks if the Object in a map is a Number
, and intValue() is called on it.
If it is not, then Double.parseDouble() is called on the string representation of the object. If the string
is not parseable as a double, a NumberFormatException is thrown.
Copyright © 2018. All rights reserved.