Class Node.NodeBuilder

java.lang.Object
com.github.tadukoo.parsing.fileformat.Node.NodeBuilder
Enclosing class:
Node

public static class Node.NodeBuilder extends Object
Node Builder is used to build a Node. It has the following parameters:
Node Parameters
Parameter Description Default or Required
title The name for the piece of data Required
data The actual data Defaults to null/empty
level The level of the Node (basically how many times you can call Node.getParent() from here) Defaults to 0
parent The parent Node to this one Defaults to null
child The child Node to this one Defaults to null
prevSibling The previous sibling Node to this one Defaults to null
nextSibling The next sibling Node to this one Defaults to null
Version:
Alpha v.0.3
Author:
Logan Ferree (Tadukoo)
  • Field Details

    • title

      private String title
      The name for the piece of data
    • data

      private String data
      The actual data
    • level

      private int level
      The level of the Node (basically how many times you can call Node.getParent() from here)
    • parent

      private Node parent
      The parent Node to this one
    • child

      private Node child
      The child Node to this one
    • prevSibling

      private Node prevSibling
      The previous sibling Node to this one
    • nextSibling

      private Node nextSibling
      The next sibling Node to this one
  • Constructor Details

    • NodeBuilder

      private NodeBuilder()
      Can't create NodeBuilder outside of Node
  • Method Details

    • title

      public Node.NodeBuilder title(String title)
      Parameters:
      title - The name for the piece of data
      Returns:
      this, to continue building
    • data

      public Node.NodeBuilder data(String data)
      Parameters:
      data - The actual data
      Returns:
      this, to continue building
    • level

      public Node.NodeBuilder level(int level)
      Parameters:
      level - The level of the Node (basically how many times you can call Node.getParent() from here)
      Returns:
      this, to continue building
    • parent

      public Node.NodeBuilder parent(Node parent)
      Parameters:
      parent - The parent Node to this one
      Returns:
      this, to continue building
    • child

      public Node.NodeBuilder child(Node child)
      Parameters:
      child - The child Node to this one
      Returns:
      this, to continue building
    • prevSibling

      public Node.NodeBuilder prevSibling(Node prevSibling)
      Parameters:
      prevSibling - The previous sibling Node to this one
      Returns:
      this, to continue building
    • nextSibling

      public Node.NodeBuilder nextSibling(Node nextSibling)
      Parameters:
      nextSibling - The next sibling Node to this one
      Returns:
      this, to continue building
    • checkForErrors

      private void checkForErrors()
      Checks for errors in the current parameters
    • build

      public Node build()
      Builds a new Node using the specified parameters
      Returns:
      A newly built Node