Package io.opencensus.trace
Class AttributeValue.AttributeValueString
java.lang.Object
io.opencensus.trace.AttributeValue
io.opencensus.trace.AttributeValue.AttributeValueString
- Direct Known Subclasses:
AutoValue_AttributeValue_AttributeValueString
- Enclosing class:
AttributeValue
-
Nested Class Summary
Nested classes/interfaces inherited from class io.opencensus.trace.AttributeValue
AttributeValue.AttributeValueBoolean, AttributeValue.AttributeValueDouble, AttributeValue.AttributeValueLong, AttributeValue.AttributeValueString
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static AttributeValue
(package private) abstract String
final <T> T
match
(Function<? super String, T> stringFunction, Function<? super Boolean, T> booleanFunction, Function<? super Long, T> longFunction, Function<? super Double, T> doubleFunction, Function<Object, T> defaultFunction) Applies a function to the underlying value.final <T> T
match
(Function<? super String, T> stringFunction, Function<? super Boolean, T> booleanFunction, Function<? super Long, T> longFunction, Function<Object, T> defaultFunction) Applies a function to the underlying value.Methods inherited from class io.opencensus.trace.AttributeValue
booleanAttributeValue, doubleAttributeValue, longAttributeValue, stringAttributeValue
-
Constructor Details
-
AttributeValueString
AttributeValueString()
-
-
Method Details
-
create
-
match
public final <T> T match(Function<? super String, T> stringFunction, Function<? super Boolean, T> booleanFunction, Function<? super Long, T> longFunction, Function<Object, T> defaultFunction) Description copied from class:AttributeValue
Applies a function to the underlying value. The function that is called depends on the value's type, which can beString
,Long
, orBoolean
.- Specified by:
match
in classAttributeValue
- Parameters:
stringFunction
- the function that should be applied if the value has typeString
.booleanFunction
- the function that should be applied if the value has typeBoolean
.longFunction
- the function that should be applied if the value has typeLong
.defaultFunction
- the function that should be applied if the value has a type that was added after thismatch
method was added to the API. SeeFunctions
for some common functions for handling unknown types.- Returns:
- the result of the function applied to the underlying value.
-
match
public final <T> T match(Function<? super String, T> stringFunction, Function<? super Boolean, T> booleanFunction, Function<? super Long, T> longFunction, Function<? super Double, T> doubleFunction, Function<Object, T> defaultFunction) Description copied from class:AttributeValue
Applies a function to the underlying value. The function that is called depends on the value's type, which can beString
,Long
, orBoolean
.- Specified by:
match
in classAttributeValue
- Parameters:
stringFunction
- the function that should be applied if the value has typeString
.booleanFunction
- the function that should be applied if the value has typeBoolean
.longFunction
- the function that should be applied if the value has typeLong
.doubleFunction
- the function that should be applied if the value has typeDouble
.defaultFunction
- the function that should be applied if the value has a type that was added after thismatch
method was added to the API. SeeFunctions
for some common functions for handling unknown types.- Returns:
- the result of the function applied to the underlying value.
-
getStringValue
-