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.legacy;
10 import java.util.List;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.restconf.common.context.WriterParameters;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
18 * A RFC8040 overlay over {@link WriterParameters}. This holds various options acquired from a requests's query part.
19 * This class needs to be further split up to make sense of it, as parts of it pertain to how a
20 * {@link NormalizedNodePayload} should be created while others how it needs to be processed (for example filtered).
22 public final class QueryParameters extends WriterParameters {
23 public static final class Builder extends WriterParametersBuilder {
24 private List<YangInstanceIdentifier> fieldPaths;
25 private List<Set<QName>> fields;
26 private String withDefault;
27 private String content;
33 public Builder setContent(final String content) {
34 this.content = content;
38 public Builder setFields(final List<Set<QName>> fields) {
43 public Builder setFieldPaths(final List<YangInstanceIdentifier> fieldPaths) {
44 this.fieldPaths = fieldPaths;
48 public Builder setWithDefault(final String withDefault) {
49 this.withDefault = withDefault;
54 public @NonNull QueryParameters build() {
55 return new QueryParameters(this);
59 private static final @NonNull QueryParameters EMPTY = new Builder().build();
61 private final List<YangInstanceIdentifier> fieldPaths;
62 private final List<Set<QName>> fields;
63 private final String withDefault;
64 private final String content;
66 private QueryParameters(final Builder builder) {
68 content = builder.content;
69 fields = builder.fields;
70 fieldPaths = builder.fieldPaths;
71 withDefault = builder.withDefault;
74 public static @NonNull QueryParameters empty() {
78 public static @NonNull Builder builder() {
82 public String getContent() {
86 public List<Set<QName>> getFields() {
90 public List<YangInstanceIdentifier> getFieldPaths() {
94 public String getWithDefault() {