Package com.clover.sdk.cashdrawer
Class CashDrawers
- java.lang.Object
-
- com.clover.sdk.cashdrawer.CashDrawers
-
public class CashDrawers extends Object
This class provides functions for working with cash drawers. Specifically, it allows clients to list all connected cash drawers from known hardware types. More types of cash drawers may be added over time. This class differs from theCashDrawer
class in that it abstracts any hardware cash drawer, whereCashDrawer
only works with cash drawers connected to configured Clover printers. Old implementations of this class used a hardcoded list of supported cash drawers, this newer implementation allows Clover to add support for new cash drawer types as they become available.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CashDrawers.Contract
For internal use only.
-
Constructor Summary
Constructors Constructor Description CashDrawers(Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<CashDrawer>
list()
Discover cash drawers supported at this time by this device.void
registerDiscovery(CashDrawer.Discovery<? extends CashDrawer> d)
Register a new cash drawer hardware type.
-
-
-
Constructor Detail
-
CashDrawers
public CashDrawers(Context context)
-
-
Method Detail
-
list
public Set<CashDrawer> list()
Discover cash drawers supported at this time by this device. Discovery of a cash drawer does not guarantee that it is actually connected at this very moment. Discovery of a cash drawer only indicates that it is either connected now, or there is a available hardware port allowing one to be connected.For example local RJ12-type cash drawers may or may not actually be connected at the time this method is invoked but will be returned regardless. Other types of cash drawers may only be discovered if they are physically connected such as USB cash drawers.
This method may perform blocking I/O and must not be invoked on the main thread.
- See Also:
CashDrawer
-
registerDiscovery
public void registerDiscovery(CashDrawer.Discovery<? extends CashDrawer> d)
Register a new cash drawer hardware type. Subsequent calls tolist()
will invoke this discovery mechanism.
-
-