Package io.opencensus.trace
Class Annotation
- java.lang.Object
-
- io.opencensus.trace.Annotation
-
- Direct Known Subclasses:
AutoValue_Annotation
@Immutable public abstract class Annotation extends java.lang.Object
A text annotation with a set of attributes.- Since:
- 0.5
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<java.lang.String,AttributeValue>
EMPTY_ATTRIBUTES
-
Constructor Summary
Constructors Constructor Description Annotation()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Annotation
fromDescription(java.lang.String description)
Returns a newAnnotation
with the given description.static Annotation
fromDescriptionAndAttributes(java.lang.String description, java.util.Map<java.lang.String,AttributeValue> attributes)
Returns a newAnnotation
with the given description and set of attributes.abstract java.util.Map<java.lang.String,AttributeValue>
getAttributes()
Return the attributes of theAnnotation
.abstract java.lang.String
getDescription()
Return the description of theAnnotation
.
-
-
-
Field Detail
-
EMPTY_ATTRIBUTES
private static final java.util.Map<java.lang.String,AttributeValue> EMPTY_ATTRIBUTES
-
-
Method Detail
-
fromDescription
public static Annotation fromDescription(java.lang.String description)
Returns a newAnnotation
with the given description.- Parameters:
description
- the text description of theAnnotation
.- Returns:
- a new
Annotation
with the given description. - Throws:
java.lang.NullPointerException
- ifdescription
isnull
.- Since:
- 0.5
-
fromDescriptionAndAttributes
public static Annotation fromDescriptionAndAttributes(java.lang.String description, java.util.Map<java.lang.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:
java.lang.NullPointerException
- ifdescription
orattributes
arenull
.- Since:
- 0.5
-
getDescription
public abstract java.lang.String getDescription()
Return the description of theAnnotation
.- Returns:
- the description of the
Annotation
. - Since:
- 0.5
-
getAttributes
public abstract java.util.Map<java.lang.String,AttributeValue> getAttributes()
Return the attributes of theAnnotation
.- Returns:
- the attributes of the
Annotation
. - Since:
- 0.5
-
-