X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2FContentParam.java;h=ba55a9b8a697fc9ee6b7538c9a290ff5cc7f4401;hb=8365ae3952c207c6b78ff45125706f7aae90d237;hp=35a9248af9f98650c0234f40c3c838db2cd0f326;hpb=62cfff9642b76129c1be626aa8eb8359ae6dd26e;p=netconf.git diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/ContentParam.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/ContentParam.java index 35a9248af9..ba55a9b8a6 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/ContentParam.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/ContentParam.java @@ -55,16 +55,12 @@ public enum ContentParam implements RestconfQueryParam { } public static @NonNull ContentParam forUriValue(final String uriValue) { - switch (uriValue) { - case "all": - return ALL; - case "config": - return CONFIG; - case "nonconfig": - return NONCONFIG; - default: - throw new IllegalArgumentException( - "Value can be 'all', 'config' or 'nonconfig', not '" + uriValue + "'"); - } + return switch (uriValue) { + case "all" -> ALL; + case "config" -> CONFIG; + case "nonconfig" -> NONCONFIG; + default -> throw new IllegalArgumentException( + "Value can be 'all', 'config' or 'nonconfig', not '" + uriValue + "'"); + }; } }