org.eclipse.microprofile.opentracing.tck.tracer

## Class TestSpanTree

- java.lang.Object
- - org.eclipse.microprofile.opentracing.tck.tracer.TestSpanTree

All Implemented Interfaces:
  ConsumableTree<TestSpan>

    public class TestSpanTree
    extends Object
    implements ConsumableTree<TestSpan>

Represents a tree of spans.

### Nested Class Summary

Nested Classes
`static class` `TestSpanTree.TreeNode<T>` Generic tree structure.

### Constructor Summary

Constructors
Constructor and Description
`TestSpanTree()` Create a tree with the default JSON display node name.
`TestSpanTree(String jsonNodeName)` Create a tree with a particular JSON display node name.
`TestSpanTree(TestSpanTree.TreeNode<TestSpan>... newRootSpans)` Create a tree with a particular JSON display node name.

### Method Summary

All Methods Instance Methods Concrete Methods
`TestSpanTree.TreeNode<TestSpan>` `addRootNode(TestSpanTree.TreeNode<TestSpan> node)` Add a root span.
`boolean` `equals(Object obj)`
`List<TestSpanTree.TreeNode<TestSpan>>` `getRootSpans()` Return a list of this tree's root spans.
`int` `hashCode()`
`String` `toString()`
`void` `visitTree(Consumer<? super TestSpan> visitor)` Visit every `TestSpan` in this tree with the `visitor` lambda.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### TestSpanTree

    public TestSpanTree()

Create a tree with the default JSON display node name.

#### TestSpanTree

    public TestSpanTree(String jsonNodeName)

Create a tree with a particular JSON display node name.

Parameters:
  `jsonNodeName` - JSON node name.

#### TestSpanTree

    @SafeVarargs
    public TestSpanTree(TestSpanTree.TreeNode<TestSpan>... newRootSpans)

Create a tree with a particular JSON display node name.

Parameters:
  `newRootSpans` - Root spans

### Method Detail

#### getRootSpans

    public List<TestSpanTree.TreeNode<TestSpan>> getRootSpans()

Return a list of this tree's root spans.

Returns:
  List of root spans.

#### addRootNode

    public TestSpanTree.TreeNode<TestSpan> addRootNode(TestSpanTree.TreeNode<TestSpan> node)

Add a root span.

Parameters:
  `node` - The node to add.
Returns:
  The added node.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### visitTree

    public void visitTree(Consumer<? super TestSpan> visitor)

Visit every `TestSpan` in this tree with the `visitor` lambda.

Specified by:
  `visitTree` in interface `ConsumableTree<TestSpan>`
Parameters:
  `visitor` - Lambda