Package io.hekate.util.trace
Class TraceInfo
- java.lang.Object
-
- io.hekate.util.trace.TraceInfo
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TraceInfo
extract(Object obj)
Tries to extractTraceInfo
from the specified object.String
name()
Name of this trace.static TraceInfo
of(String name)
Constructs a new instance.Map<String,Object>
tags()
Tags of this trace.String
toString()
TraceInfo
withTag(String name, Object value)
Adds a new tag to this trace.
-
-
-
Method Detail
-
extract
public static TraceInfo extract(Object obj)
Tries to extractTraceInfo
from the specified object.If object is an instance of
Traceable
interface then itsTraceable.traceInfo()
will be returned; otherwise this method returnsnull
.- Parameters:
obj
- Object.- Returns:
- Tracing information if the specified object is on
Traceable
type; otherwisenull
.
-
name
public String name()
Name of this trace.- Returns:
- Name of this trace.
-
withTag
public TraceInfo withTag(String name, Object value)
Adds a new tag to this trace.- Parameters:
name
- Tag name.value
- Tag value.- Returns:
- This instance.
-
-