2 * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.restconf.nb.rfc8040;
10 import static java.util.Objects.requireNonNull;
13 import org.eclipse.jdt.annotation.NonNull;
16 * Enumeration of possible {@code with-defaults} parameter values as defined by
17 * <a href="https://datatracker.ietf.org/doc/html/rfc8040#section-4.8.9">RFC8040, section 4.8.9</a>.
19 public enum WithDefaultsParam implements RestconfQueryParam<WithDefaultsParam> {
21 * Data nodes set to the YANG default by the client are reported.
25 * All data nodes are reported.
27 REPORT_ALL("report-all"),
29 * All data nodes are reported, and defaults are tagged.
31 REPORT_ALL_TAGGED("report-all-tagged"),
33 * Data nodes set to the YANG default are not reported.
37 // API consistency: must not be confused with enum constants
38 @SuppressWarnings("checkstyle:ConstantName")
39 public static final @NonNull String uriName = "with-defaults";
41 private static final @NonNull URI CAPABILITY = URI.create("urn:ietf:params:restconf:capability:with-defaults:1.0");
43 private final @NonNull String uriValue;
45 WithDefaultsParam(final String uriValue) {
46 this.uriValue = requireNonNull(uriValue);
50 public Class<@NonNull WithDefaultsParam> javaClass() {
51 return WithDefaultsParam.class;
55 public String paramName() {
60 public String paramValue() {
64 public static @NonNull WithDefaultsParam forUriValue(final String uriValue) {
70 case "report-all-tagged":
71 return REPORT_ALL_TAGGED;
75 throw new IllegalArgumentException(
76 "Value can be 'explicit', 'report-all', 'report-all-tagged' or 'trim', not '" + uriValue + "'");
80 public static @NonNull URI capabilityUri() {