Class BeverageMix
java.lang.Object
com.tccc.kos.ext.freestyle.service.brandset.beans.BeverageMix
The combination of a
MixPart
objects that form a mixed
beverage. A mix may be a composition (all poured at the same
time with relative ratios) or sequence (poured in sequence
using ratios of the total volume).
If all part seqIdx values are zero then the mix is a composite, otherwise it is a sequence and the parts will be sorted by seqIdx. If there are any duplicate seqIdx values in a sequence then the order of these parts is effectively random.
When constructed programmatically use add(part)
which
will determine if the mix is a sequence or not. When used with
json deserialization, the parts must be in the correct order
and the sequence flag must be set if the mix is a sequence.
- Version:
- 2023-10-19
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BeverageMix
public BeverageMix()
-
-
Method Details
-
add
Add a part to the mix. -
isSequence
public boolean isSequence()Return true if the mix is a sequence, false if it's a composite. The first time this is called it will analyze the parts to determine the state of the mix and then cache the results. Adding to the mix usingadd()
will clear the cached results, but adding directly to the list will not.A mix is a sequence if any of the parts has a
seqIdx
that is non-zero. -
isEmpty
public boolean isEmpty()Return true if the mix has no parts. -
getParts
-
setParts
-