Package io.opencensus.trace
Class Annotation
java.lang.Object
io.opencensus.trace.Annotation
- Direct Known Subclasses:
AutoValue_Annotation
A text annotation with a set of attributes.
- Since:
- 0.5
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Annotation
fromDescription
(String description) Returns a newAnnotation
with the given description.static Annotation
fromDescriptionAndAttributes
(String description, Map<String, AttributeValue> attributes) Returns a newAnnotation
with the given description and set of attributes.abstract Map
<String, AttributeValue> Return the attributes of theAnnotation
.abstract String
Return the description of theAnnotation
.
-
Field Details
-
EMPTY_ATTRIBUTES
-
-
Constructor Details
-
Annotation
Annotation()
-
-
Method Details
-
fromDescription
Returns a newAnnotation
with the given description.- Parameters:
description
- the text description of theAnnotation
.- Returns:
- a new
Annotation
with the given description. - Throws:
NullPointerException
- ifdescription
isnull
.- Since:
- 0.5
-
fromDescriptionAndAttributes
public static Annotation fromDescriptionAndAttributes(String description, Map<String, AttributeValue> attributes) Returns a newAnnotation
with the given description and set of attributes.- Parameters:
description
- the text description of theAnnotation
.attributes
- the attributes of theAnnotation
.- Returns:
- a new
Annotation
with the given description and set of attributes. - Throws:
NullPointerException
- ifdescription
orattributes
arenull
.- Since:
- 0.5
-
getDescription
Return the description of theAnnotation
.- Returns:
- the description of the
Annotation
. - Since:
- 0.5
-
getAttributes
Return the attributes of theAnnotation
.- Returns:
- the attributes of the
Annotation
. - Since:
- 0.5
-