Class AssignmentService
java.lang.Object
com.kosdev.kos.ext.dispense.service.assignment.AssignmentService
Service that allows ingredients to be manually assigned to holders.
This will persist the assignments so they survive reboots. This can
be used for typical dispensers that require that ingredient be
manually mapped during installation / setup.
- Since:
- 1
- Version:
- 1
-
Method Summary
Modifier and TypeMethodDescriptionvoidassign(Assignment a) Assign an ingredient to a holder.Return the collection of active assignments.voidSet the container factory to use when creating containers to use for assignments.voidUnassign a holder if it is currently assigned.
-
Method Details
-
setContainerFactory
Set the container factory to use when creating containers to use for assignments. This allows applications to insert much more complex containers that have more features such as fuel gauges or whatever is desired. The assignment object contains optionalfactoryJsonwhich allows complex data to be passed through to the factory.The default factory returns base
Containerinstances. If replacing the factory, it should be replaced before the core assembly is installed as this triggers the containers to be created.- Since:
- 1
-
assign
Assign an ingredient to a holder.- Throws:
Exception- Since:
- 1
-
unassign
Unassign a holder if it is currently assigned.- Since:
- 1
-
getAssignments
Return the collection of active assignments.- Since:
- 1
-
getContainerFactory
-