Interface TreeBuilder


public interface TreeBuilder
A Tree builder. Gathers required config, such as nodes and connections between nodes and builds the Tree.
  • Field Details

  • Method Details

    • name

      TreeBuilder name(String name)
      Sets the name of the tree.
      Parameters:
      name - the name.
      Returns:
      this builder.
    • entryNode

      TreeBuilder entryNode(NodeBuilder entryNode)
      Sets the entry node.
      Parameters:
      entryNode - the entry node.
      Returns:
      this builder.
    • description

      TreeBuilder description(String description)
      Sets the description of the tree.
      Parameters:
      description - the description.
      Returns:
      this builder.
    • build

      void build() throws SMSException, SSOException
      Builds the tree using the config set.
      Throws:
      SMSException - if there is a SMSException.
      SSOException - if there is a SSOException.
      IOException - if there is an IOException.
    • add

      TreeBuilder add(NodeBuilder nodeBuilder)
      Adds a Node to the tree.
      Parameters:
      nodeBuilder - a builder representing the Node.
      Returns:
      this builder.
    • add

      TreeBuilder add(NodeBuilder... nodeBuilders)
      Adds nodes to the tree.
      Parameters:
      nodeBuilders - the builder of each of the nodes.
      Returns:
      this builder.
    • connect

      TreeBuilder connect(NodeBuilder nodeBuilder, UUID destination)
      Connects the single outcome of a Node to a destination.
      Parameters:
      nodeBuilder - the builder representing a Node.
      destination - the destination, usually a Node ID.
      Returns:
      this builder.
    • connect

      TreeBuilder connect(NodeBuilder nodeBuilder, NodeBuilder destination)
      Connects the single outcome of a Node to a destination Node.
      Parameters:
      nodeBuilder - the builder representing a Node.
      destination - the builder representing a destination Node.
      Returns:
      this builder.
    • connect

      TreeBuilder connect(NodeBuilder nodeBuilder, String outcome, UUID destination)
      Connects a specific outcome of a Node to a destination.
      Parameters:
      nodeBuilder - the builder representing a Node.
      outcome - the outcome of the Node.
      destination - the destination, usually a Node ID.
      Returns:
      this builder.
    • connect

      TreeBuilder connect(NodeBuilder nodeBuilder, String outcome, NodeBuilder destination)
      Connects a specific outcome of a Node to a destination Node.
      Parameters:
      nodeBuilder - the builder representing a Node.
      outcome - the outcome.
      destination - the destination Node.
      Returns:
      this builder.
    • addNodeConfig

      void addNodeConfig(String name, Map<String,Set<String>> attributes)
      Adds node config, using the node name and attributes for that node.
      Parameters:
      name - the nodes name.
      attributes - the attributes for that node.
    • getNodeServiceName

      String getNodeServiceName(Class<? extends Node> clazz)
      Returns the name of the service of the supplied node class.
      Parameters:
      clazz - the node class.
      Returns:
      the name of the service.
    • getNodeVersion

      Integer getNodeVersion(Class<? extends Node> clazz)
      Returns the version of the node class.
      Parameters:
      clazz - the node class.
      Returns:
      the version.