@Immutable public final class StringAttributeSetter extends Object
| Modifier and Type | Method and Description |
|---|---|
static StringAttributeSetter |
create(String attributeKey)
Returns a new attribute setter.
|
String |
key()
Returns the attribute name.
|
void |
set(Attributes.Builder attributesBuilder,
String value)
Sets the attribute on the provided
Attributes.Builder. |
void |
set(Span.Builder spanBuilder,
String value)
Sets the attribute on the provided span builder.
|
void |
set(Span span,
String value)
Sets the attribute on the provided span.
|
String |
toString() |
public static StringAttributeSetter create(String attributeKey)
attributeKey - the attribute namepublic String key()
public void set(Span span, @Nullable String value)
span - the span to add the attribute tovalue - the value for this attributepublic void set(Span.Builder spanBuilder, @Nullable String value)
spanBuilder - the span builder to add the attribute tovalue - the value for this attributepublic void set(Attributes.Builder attributesBuilder, @Nullable String value)
Attributes.Builder.attributesBuilder - the attributes builder to add the attribute tovalue - the value for this attribute