Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onBarcode(final String barcode) {
- final var message = processBarcode(barcode);
- display.displayMessage(message);
- }
- private String processBarcode(final String barcode) {
- if (barcode.isEmpty()) {
- return display.getDisplayEmptyBarcodeMessage();
- } else {
- final Price price = catalog.findPrice(barcode);
- if (price == null) {
- return display.getDisplayProductNotFoundMessage(barcode);
- } else {
- return display.getDisplayPriceMessage(price);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement