Use exhaustiveness of a switch expression to peel an impossible case.
Change-Id: I7d1d228484656fc81b51762878d569698d570f80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
}
public TreeType getTreeType() {
- switch (datastoreContext.getLogicalStoreType()) {
- case CONFIGURATION:
- return TreeType.CONFIGURATION;
- case OPERATIONAL:
- return TreeType.OPERATIONAL;
- default:
- throw new IllegalStateException("Unhandled logical store type "
- + datastoreContext.getLogicalStoreType());
- }
+ return switch (datastoreContext.getLogicalStoreType()) {
+ case CONFIGURATION -> TreeType.CONFIGURATION;
+ case OPERATIONAL -> TreeType.OPERATIONAL;
+ };
}
protected void verify() {