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 org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.concepts.Immutable;
14 * Interface implemented by all Java classes which represent a
15 * <a href="https://datatracker.ietf.org/doc/html/rfc8040#section-4.8">RESTCONF query parameter</a>.
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.
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.
25 // FIXME: sealed when we have JDK17+?
26 public interface RestconfQueryParam<T extends RestconfQueryParam<T>> extends Immutable {
28 * Return the Java representation class.
30 * @return the Java representation class
32 @NonNull Class<@NonNull T> javaClass();
35 * Return the URI Request parameter name.
37 * @return the URI Request parameter name.
39 @NonNull String paramName();
42 * Return the URI Request parameter value.
44 * @return the URI Request parameter value.
46 @NonNull String paramValue();