Add Child Nodes Only query parameter to SSE events
[netconf.git] / protocol / restconf-api / src / main / java / org / opendaylight / restconf / api / query / RestconfQueryParam.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.restconf.api.query;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.concepts.Immutable;
12
13 /**
14  * Interface implemented by all Java classes which represent a
15  * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-4.8">RESTCONF query parameter</a>.
16  *
17  * <p>
18  * Implementations of this interface are required to expose a {@code public static @NonNull uriName} constant, which
19  * holds the well-known URI Request Query Parameter name of the associated definition.
20  *
21  * <p>
22  * This naming violates the usual Java coding style, we need it to keep API consistency as an enum can be used as an
23  * implementation, in which case users could be confused by upper-case constants which are not enum members.
24  */
25 public sealed interface RestconfQueryParam<T extends RestconfQueryParam<T>> extends Immutable
26         permits ContentParam, DepthParam, FieldsParam, FilterParam, InsertParam, PointParam, WithDefaultsParam,
27                 AbstractReplayParam,
28                 // ODL extensions
29                 ChangedLeafNodesOnlyParam, LeafNodesOnlyParam, PrettyPrintParam, SkipNotificationDataParam,
30                 ChildNodesOnlyParam {
31     /**
32      * Return the Java representation class.
33      *
34      * @return the Java representation class
35      */
36     @NonNull Class<@NonNull T> javaClass();
37
38     /**
39      * Return the URI Request parameter name.
40      *
41      * @return the URI Request parameter name.
42      */
43     @NonNull String paramName();
44
45     /**
46      * Return the URI Request parameter value.
47      *
48      * @return the URI Request parameter value.
49      */
50     @NonNull String paramValue();
51 }