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.ObjectA 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 AnnotationfromDescription(java.lang.String description)Returns a newAnnotationwith the given description.static AnnotationfromDescriptionAndAttributes(java.lang.String description, java.util.Map<java.lang.String,AttributeValue> attributes)Returns a newAnnotationwith the given description and set of attributes.abstract java.util.Map<java.lang.String,AttributeValue>getAttributes()Return the attributes of theAnnotation.abstract java.lang.StringgetDescription()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 newAnnotationwith the given description.- Parameters:
description- the text description of theAnnotation.- Returns:
- a new
Annotationwith the given description. - Throws:
java.lang.NullPointerException- ifdescriptionisnull.- Since:
- 0.5
-
fromDescriptionAndAttributes
public static Annotation fromDescriptionAndAttributes(java.lang.String description, java.util.Map<java.lang.String,AttributeValue> attributes)
Returns a newAnnotationwith the given description and set of attributes.- Parameters:
description- the text description of theAnnotation.attributes- the attributes of theAnnotation.- Returns:
- a new
Annotationwith the given description and set of attributes. - Throws:
java.lang.NullPointerException- ifdescriptionorattributesarenull.- 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
-
-