Class TraceInfo


  • public final class TraceInfo
    extends Object
    Information about a Traceable object.
    • Method Detail

      • extract

        public static TraceInfo extract​(Object obj)
        Tries to extract TraceInfo from the specified object.

        If object is an instance of Traceable interface then its Traceable.traceInfo() will be returned; otherwise this method returns null.

        Parameters:
        obj - Object.
        Returns:
        Tracing information if the specified object is on Traceable type; otherwise null.
      • of

        public static TraceInfo of​(String name)
        Constructs a new instance.
        Parameters:
        name - Trace name (see name()).
        Returns:
        New instance of TraceInfo.
      • name

        public String name()
        Name of this trace.
        Returns:
        Name of this trace.
      • tags

        public Map<String,​Object> tags()
        Tags of this trace.
        Returns:
        Tags 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.