All Implemented Interfaces:
Comparable<GraphNode>

public class BeverageNode extends AndNode
A GraphNode that represents a beverage.

This is simply an AND node with a type of "BEVERAGE". It stores an optional beverage ID into the altId field of the node, which is used in the event that the node ID cannot be the beverage ID because of ID collisions.

Child nodes of a beverage node are typically ingredient nodes. This allows for a single representation of a beverage even if there are multiple ways to pour it. For example, consider a beverage that requires water and Coke. If there are two pumps with Coke, then there are two ways to pour this beverage. This node will be available if either of the two ways to pour Coke are available.

There is no strict requirement that beverages/brands/groups contain BeverageNode nodes. This simply exists as a convenience for most common use cases.

Since:
1.0
Version:
2023-02-10
  • Field Details

  • Constructor Details

    • BeverageNode

      public BeverageNode(String beverageId)
      Creates a beverage node where the given beverageId is both the id and altId of the node.
      Parameters:
      beverageId - both ID and altId of the node
    • BeverageNode

      public BeverageNode(String id, String beverageId)
      Creates a beverage node where the id of the node is distinct from the associated beverageId . The beverageId is stored in the node's altId field.
      Parameters:
      id - ID of the node
      beverageId - beverageId of the node
  • Method Details

    • getBeverageId

      public String getBeverageId()
      Returns the beverage ID of the node, which is this node's altId .
    • toString

      public String toString()
      Overrides:
      toString in class GraphNode