public void when()

in sources/coffeeshop/orders-domain/src/main/java/solid/humank/coffeeshop/order/models/Order.java [193:213]


    public void when(OrderStatusChanged event) throws StatusTransitionException {
        this.suppressEvent();
        switch (event.getCurStatus()) {
            case PROCESSING:
                this.process();
                break;

            case DELIVER:
                this.deliver();
                break;

            case CLOSED:
                this.closed();
                break;

            case CANCEL:
                this.cancel();
                break;
        }
        this.unSuppressedEvent();
    }