Class ContainerHolderTrouble
java.lang.Object
com.tccc.kos.commons.core.service.trouble.Trouble
com.tccc.kos.ext.dispense.PourAvailabilityTrouble
com.tccc.kos.ext.dispense.service.insertion.troubles.ContainerHolderTrouble
- All Implemented Interfaces:
com.tccc.kos.commons.core.service.trouble.TroubleIface
,ContainerTroubleIface
,HolderTroubleIface
public class ContainerHolderTrouble
extends PourAvailabilityTrouble
implements HolderTroubleIface, ContainerTroubleIface
Base class for troubles related to a combination of container and holder.
This is commonly used for troubles generated during ingredient insertion
as the process is inherently container / holder oriented. While
ContainerTrouble
is similar in that it returns holder information,
that trouble includes troubles linked to the container whereas this trouble
only uses the specified holder as the target of the trouble which means the
holder is guaranteed to exist and there will only be one holder even if the
container has multiple slices.- Since:
- 1.0
- Version:
- 2023-02-05
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tccc.kos.commons.core.service.trouble.Trouble
com.tccc.kos.commons.core.service.trouble.Trouble.TroubleView
-
Constructor Summary
ConstructorsConstructorDescriptionContainerHolderTrouble
(Container container, Holder holder, PourAvailability.Type block) Create a new trouble for the specified container and holder. -
Method Summary
Methods inherited from class com.tccc.kos.ext.dispense.PourAvailabilityTrouble
blockBeveragePour, blockIngredientPour, blockPour
Methods inherited from class com.tccc.kos.commons.core.service.trouble.Trouble
addIface, addImpacted, addLink, addTag, equals, getClientData, getCount, getCreateTime, getGroup, getId, getIfaces, getImpacted, getInfo, getLinked, getReason, getTags, getType, hashCode, incCount, isImpacted, isLinked, isResolvable, isTagged, onRemoved, removeImpacted, removeLink, removeTag, resolvable, resolve, setReason, setResolvable, toString
-
Constructor Details
-
ContainerHolderTrouble
Create a new trouble for the specified container and holder. The container is expected to be connected to the holder. UnlikeContainerTrouble
this will only list the holder provided to this trouble whereas aContainerTrouble
will list all connected holders. In most cases this is effectively the same but when using multi-ingredient containers such as Freestyle double cartridges this allows the trouble to be specific to the specified holder.This will automatically tag the container so if the container is removed the trouble will automatically be removed.
This trouble can block pouring on any pumps connected to the container. The block parameter defines the type of block to apply. If no block is needed this can be null. The block will be removed when the trouble is removed.
- Parameters:
container
- the container the trouble is forblock
- the block to apply to pumps connected to the container
-
-
Method Details
-
getHolderPaths
Description copied from interface:HolderTroubleIface
Returns the paths of the associated holders. ManyTrouble
s only impact a single holder, but some impact more than one, so this provides a uniform mechanism to handle all varieties.- Specified by:
getHolderPaths
in interfaceHolderTroubleIface
-
getHolderNames
Description copied from interface:HolderTroubleIface
Returns the holder names in the same order as the paths. This allowsTrouble
s to be rendered without needing to look up the holders from the paths to get the names.- Specified by:
getHolderNames
in interfaceHolderTroubleIface
-
getContainerId
Description copied from interface:ContainerTroubleIface
Returns the container ID.- Specified by:
getContainerId
in interfaceContainerTroubleIface
-
getIngredients
Description copied from interface:ContainerTroubleIface
Returns the ingredients in the container in slice order.- Specified by:
getIngredients
in interfaceContainerTroubleIface
-
getContainer
-
getHolder
-