- ActorRef newShardTransaction(TransactionType type, TransactionIdentifier transactionID) {
- final AbstractShardDataTreeTransaction<?> transaction;
- switch (type) {
- case READ_ONLY:
- transaction = dataTree.newReadOnlyTransaction(transactionID);
- break;
- case READ_WRITE:
- case WRITE_ONLY:
- transaction = dataTree.newReadWriteTransaction(transactionID);
- break;
- default:
- throw new IllegalArgumentException("Unsupported transaction type " + type);
- }
-
+ ActorRef newShardTransaction(final TransactionType type, final TransactionIdentifier transactionID) {
+ final AbstractShardDataTreeTransaction<?> transaction = switch (type) {
+ case READ_ONLY -> dataTree.newReadOnlyTransaction(transactionID);
+ case READ_WRITE, WRITE_ONLY -> dataTree.newReadWriteTransaction(transactionID);
+ default -> throw new IllegalArgumentException("Unsupported transaction type " + type);
+ };