Refactor pretty printing
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / server / api / DataGetParams.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.server.api;
9
10 import static java.util.Objects.requireNonNull;
11
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.eclipse.jdt.annotation.Nullable;
14 import org.opendaylight.restconf.api.query.ContentParam;
15 import org.opendaylight.restconf.api.query.DepthParam;
16 import org.opendaylight.restconf.api.query.FieldsParam;
17 import org.opendaylight.restconf.api.query.PrettyPrintParam;
18 import org.opendaylight.restconf.api.query.WithDefaultsParam;
19
20 /**
21  * Supported query parameters of {@code /data} {@code GET} HTTP operation, as defined in
22  * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-4.3">RFC8040 section 4.3</a>.
23  */
24 public record DataGetParams(
25         @NonNull ContentParam content,
26         @Nullable DepthParam depth,
27         @Nullable FieldsParam fields,
28         @Nullable WithDefaultsParam withDefaults,
29         @NonNull PrettyPrintParam prettyPrint) implements FormatParameters {
30     public static final @NonNull DataGetParams EMPTY =
31         new DataGetParams(ContentParam.ALL, null, null, null, PrettyPrintParam.FALSE);
32
33     public DataGetParams {
34         requireNonNull(content);
35         requireNonNull(prettyPrint);
36     }
37 }