Class Pourable
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
DelayPourable
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 -
Method Summary
Modifier and TypeMethodDescriptionclone()
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.Collection<Pump<?>>
getPumps()
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.
-
Constructor Details
-
Pourable
public Pourable()
-
-
Method Details
-
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
Return the pumps associated with the actual pour. This list is only available once theBeveragePumpEventInitiator
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
- Throws:
CloneNotSupportedException
-