java.lang.Object
com.tccc.kos.ext.dispense.pipeline.beverage.Pourable
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DelayPourable

public abstract class Pourable extends Object implements Cloneable
Base class for a representation of something that can be poured using a PourEngine. Pourables are Cloneable which allows a single Pourable to be cloned multiple times for individual pours. It also allows a single Pourable to be cloned and used in a sequence to split a single pour into parts.

A Pourable has an effective volume which constrains the volume of the pour. The effective volume may be less than the configued volume when a limit is applied to a PourSequence containing the pourable.

Once Pourable has been added to a PourSequence is can no longer be modified.

A Pourable that is part of a PourSequence can return the start and stop percent of the pourable within the sequence relative to the overall target volume (independent of an applied limit). This can be used by non-homogeneous pours to determine where in the pour process to start / end the pour.

Since:
1.0
Version:
2023-02-06
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Return an object that represents the definition used to create the pourable.
    double
    Return the effective volume to pour from this pourable which takes into account any limits applied.
    Return the pumps associated with the actual pour.
    double
    Return the start percent of this pourable relative to the total volume of the sequence.
    double
    Return the stop percent of this pourable relative to the total volume of the sequence.
    double
    Return the configured volume to pour.
    void
    setVolume(double volume)
    Set the volume of the pourable.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pourable

      public Pourable()
  • Method Details

    • getDefinition

      public Object getDefinition()
      Return an object that represents the definition used to create the pourable. This is exposed via endpoints to allow external systems to identify the pourable. The object returned should be safe to serialize to JSON. Override as needed for your application.
    • getVolume

      public double getVolume()
      Return the configured volume to pour. The effective volume may be less than this due to limits.
    • setVolume

      public void setVolume(double volume)
      Set the volume of the pourable.
    • getEffectiveVolume

      public double getEffectiveVolume()
      Return the effective volume to pour from this pourable which takes into account any limits applied.
    • getStartPercent

      public double getStartPercent()
      Return the start percent of this pourable relative to the total volume of the sequence. This can be used for non-homogeneous pours to determine where in the process the pour should start.
    • getStopPercent

      public double getStopPercent()
      Return the stop percent of this pourable relative to the total volume of the sequence. This can be used for non-homogenous pours to determine where in the process the pour should stop.
    • getPumps

      public Collection<Pump<?>> getPumps()
      Return the pumps associated with the actual pour. This list is only available once the BeveragePumpEventInitiator associated with the pour has pumps set and the pour has started. This is primarily useful for accessing pumps from listener callbacks.

      If called on a Pourable that has not been used to construct a pour, before the initiator is ready, or if the initiator was never populated, this will return an empty list.

    • clone

      public Object clone() throws CloneNotSupportedException
      Throws:
      CloneNotSupportedException