Package com.tailf.progress
Class Attributes
Object
com.tailf.progress.Attributes
Attributes
class is used to create,
and manipulate progress trace attributes. Attributes
can be used when creating a new event or span.
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate an empty attribute objectAttributes
(String name, String value) Instantiate an attribute object -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all existng attributesboolean
Check if attribute exists by its namestatic Attributes
Build attributes from aHashMap
Get an attribute's valuemerge
(Attributes otherAttrs) Merge 2 attribute objectsvoid
Set an attribute name and valuetoMap()
Convert the current attributes toHashMap
format
-
Constructor Details
-
Attributes
public Attributes()Instantiate an empty attribute object -
Attributes
Instantiate an attribute object- Parameters:
name
- the name of the attributevalue
- the value of the attribute
-
-
Method Details
-
set
Set an attribute name and value- Parameters:
name
- the name of the attributevalue
- the value of the attribute
-
getValue
Get an attribute's value- Parameters:
name
- the atrribute's name- Returns:
- the value as
String
. This can returnnull
if the value is not found.
-
contains
Check if attribute exists by its name- Parameters:
name
- the atrribute's name
-
toMap
Convert the current attributes toHashMap
format- Returns:
- attributes in
HashMap
-
fromMap
Build attributes from aHashMap
- Parameters:
map
- attributes inHashMap
- Returns:
Attributes
object
-
merge
Merge 2 attribute objects- Parameters:
otherAttrs
- other attributes- Returns:
- a new
Attributes
object
-
clear
public void clear()Clear all existng attributes
-