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;
11 import org.eclipse.jdt.annotation.NonNull;
14 * OpenDaylight extension parameter. When used as {@code odl-leaf-nodes-only=true}, it will instruct the listener
15 * streams to only emit leaf nodes.
17 public final class LeafNodesOnlyParam implements RestconfQueryParam<LeafNodesOnlyParam> {
18 // API consistency: must not be confused with enum constants
19 @SuppressWarnings("checkstyle:ConstantName")
20 public static final String uriName = "odl-leaf-nodes-only";
22 private static final @NonNull URI CAPABILITY =
23 URI.create("urn:opendaylight:params:restconf:capability:leaf-nodes-only:1.0");
24 private static final @NonNull LeafNodesOnlyParam FALSE = new LeafNodesOnlyParam(false);
25 private static final @NonNull LeafNodesOnlyParam TRUE = new LeafNodesOnlyParam(true);
27 private final boolean value;
29 private LeafNodesOnlyParam(final boolean value) {
33 public static @NonNull LeafNodesOnlyParam of(final boolean value) {
34 return value ? TRUE : FALSE;
37 public static @NonNull LeafNodesOnlyParam forUriValue(final String uriValue) {
44 throw new IllegalArgumentException("Value can be 'false' or 'true', not '" + uriValue + "'");
49 public Class<@NonNull LeafNodesOnlyParam> javaClass() {
50 return LeafNodesOnlyParam.class;
54 public String paramName() {
59 public String paramValue() {
60 return String.valueOf(value);
63 public boolean value() {
67 public static @NonNull URI capabilityUri() {