- switch (code) {
- case SUCCESS:
- return Status.SUCCESS;
- case FAILURE:
- return Status.FAILURE;
- case ERROR:
- case REJECT:
- throw new IllegalArgumentException("APP-C request was not accepted, code=" + code);
- case ACCEPT:
- default:
- // awaiting a "final" response
- return Status.STILL_WAITING;
- }
+ return switch (code) {
+ case SUCCESS -> Status.SUCCESS;
+ case FAILURE -> Status.FAILURE;
+ case ERROR, REJECT -> throw new IllegalArgumentException("APP-C request was not accepted, code=" + code);
+ // awaiting a "final" response
+ default -> Status.STILL_WAITING;
+ };