org.eclipse.microprofile.opentracing.tck.tracer

## Class TestSpanTree.TreeNode<T>

- java.lang.Object
- - org.eclipse.microprofile.opentracing.tck.tracer.TestSpanTree.TreeNode<T>

Type Parameters:
  `T` - Type of data to hold in the node.

All Implemented Interfaces:
  ConsumableTree<T>

Enclosing class:
  TestSpanTree

    public static class TestSpanTree.TreeNode<T>
    extends Object
    implements ConsumableTree<T>

Generic tree structure.

### Constructor Summary

Constructors
Constructor and Description
`TreeNode(T nodeData, TestSpanTree.TreeNode<T>... newChildren)` Create a new node.

### Method Summary

All Methods Instance Methods Concrete Methods
`TestSpanTree.TreeNode<T>` `addChild(TestSpanTree.TreeNode<T> child)` Add new child to this node.
`boolean` `equals(Object obj)`
`List<TestSpanTree.TreeNode<T>>` `getChildren()` Return the child nodes.
`T` `getData()` Return the data in the node.
`int` `hashCode()`
`String` `toJSON(String nodeName, int indentationLevel, String indentationCharacters)` Return JSON representation.
`String` `toString()`
`void` `visitTree(Consumer<? super T> visitor)` Recursively visit all nodes with the lambda.

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

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

### Constructor Detail

#### TreeNode

    @SafeVarargs
    public TreeNode(T nodeData,
                                 TestSpanTree.TreeNode<T>... newChildren)

Create a new node.

Parameters:
  `nodeData` - Data held in the node.
  `newChildren` - Child nodes

### Method Detail

#### getData

    public T getData()

Return the data in the node.

Returns:
  Data

#### getChildren

    public List<TestSpanTree.TreeNode<T>> getChildren()

Return the child nodes.

Returns:
  Child nodes.

#### addChild

    public TestSpanTree.TreeNode<T> addChild(TestSpanTree.TreeNode<T> child)

Add new child to this node.

Parameters:
  `child` - Child to add.
Returns:
  Newly created node.

#### toJSON

    public String toJSON(String nodeName,
                         int indentationLevel,
                         String indentationCharacters)

Return JSON representation.

Parameters:
  `nodeName` - Node name to display in JSON.
  `indentationLevel` - How many instances of indentationCharacters
  `indentationCharacters` - The indentation characters to use
Returns:
  JSON

#### 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 T> visitor)

Recursively visit all nodes with the lambda.

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

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`