Class SimpleNodeOverride

java.lang.Object
com.tccc.kos.ext.dispense.pipeline.beverage.graph.SimpleNodeOverride
All Implemented Interfaces:
NodeOverride

public class SimpleNodeOverride extends Object implements NodeOverride
Simple NodeOvrride that allows visibility and availability to be set. Setting specific values will override accordingly while setting null will allow default behavior to be used for the associated node.
Since:
1.0
Version:
2023-12-06
  • Constructor Details

    • SimpleNodeOverride

      public SimpleNodeOverride(String nodeId)
      Create a new SimpleNodeOverride that is for the specified nodeId in the beverage graph.
      Parameters:
      nodeId - the id of the node to override
  • Method Details

    • getNodeId

      public String getNodeId()
      Description copied from interface: NodeOverride
      Return the id of the node the override is for.
      Specified by:
      getNodeId in interface NodeOverride
    • onAttachNode

      public void onAttachNode(GraphNode node)
      Description copied from interface: NodeOverride
      Called when the override is attached to a node. This will be called every time the graph is rebuilt and overrides are re-applied. If there is no matching node this will be called with null.
      Specified by:
      onAttachNode in interface NodeOverride
    • computeVisible

      public Boolean computeVisible(GraphNode node)
      Description copied from interface: NodeOverride
      Called when the associated node visibility is recomputed. Return true to force the node visible or false to force the node not visible. Return null to use standard visibility logic.
      Specified by:
      computeVisible in interface NodeOverride
    • computeAvailable

      public Boolean computeAvailable(GraphNode node)
      Description copied from interface: NodeOverride
      Called when the associated node availability is recomputed. Return true to force the node available or false to force the node not available. Return null to use standard availability logic
      Specified by:
      computeAvailable in interface NodeOverride
    • setVisibility

      public void setVisibility(Boolean visibility)
      Set the visibility override. Use null to fall back to default behavior for the node.
    • setAvailability

      public void setAvailability(Boolean availability)
      Set the availability override. Use null to fall back to default behavior for the node.