2 * Copyright (c) 2015 Cisco Systems, Inc. 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.common.context;
10 import java.util.List;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 public final class WriterParameters {
16 private final String content;
17 private final Integer depth;
18 private final List<Set<QName>> fields;
19 private final List<YangInstanceIdentifier> fieldPaths;
20 private final boolean prettyPrint;
21 private final boolean tagged;
22 private final String withDefault;
24 private WriterParameters(final WriterParametersBuilder builder) {
25 this.content = builder.content;
26 this.depth = builder.depth;
27 this.fields = builder.fields;
28 this.fieldPaths = builder.fieldPaths;
29 this.prettyPrint = builder.prettyPrint;
30 this.tagged = builder.tagged;
31 this.withDefault = builder.withDefault;
34 public String getContent() {
38 public Integer getDepth() {
42 public List<Set<QName>> getFields() {
46 public List<YangInstanceIdentifier> getFieldPaths() {
47 return this.fieldPaths;
50 public boolean isPrettyPrint() {
51 return this.prettyPrint;
54 public boolean isTagged() {
58 public String getWithDefault() {
62 public static class WriterParametersBuilder {
63 private String content;
64 private Integer depth;
65 private List<Set<QName>> fields;
66 private List<YangInstanceIdentifier> fieldPaths;
67 private boolean prettyPrint;
68 private boolean tagged;
69 private String withDefault;
71 public WriterParametersBuilder() {
75 public WriterParametersBuilder setContent(final String content) {
76 this.content = content;
80 public WriterParametersBuilder setDepth(final int depth) {
85 public WriterParametersBuilder setFields(final List<Set<QName>> fields) {
90 public WriterParametersBuilder setFieldPaths(final List<YangInstanceIdentifier> fieldPaths) {
91 this.fieldPaths = fieldPaths;
95 public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
96 this.prettyPrint = prettyPrint;
100 public WriterParametersBuilder setWithDefault(final String withDefault) {
101 this.withDefault = withDefault;
105 public WriterParameters build() {
106 return new WriterParameters(this);
109 public void setTagged(final boolean tagged) {
110 this.tagged = tagged;