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;
14 public final class WriterParameters {
15 private final String content;
16 private final Integer depth;
17 private final List<Set<QName>> fields;
18 private final boolean prettyPrint;
19 private final boolean tagged;
20 private final String withDefault;
22 private WriterParameters(final WriterParametersBuilder builder) {
23 this.content = builder.content;
24 this.depth = builder.depth;
25 this.fields = builder.fields;
26 this.prettyPrint = builder.prettyPrint;
27 this.tagged = builder.tagged;
28 this.withDefault = builder.withDefault;
31 public String getContent() {
35 public Integer getDepth() {
39 public List<Set<QName>> getFields() {
43 public boolean isPrettyPrint() {
44 return this.prettyPrint;
47 public boolean isTagged() {
51 public String getWithDefault() {
55 public static class WriterParametersBuilder {
56 private String content;
57 private Integer depth;
58 private List<Set<QName>> fields;
59 private boolean prettyPrint;
60 private boolean tagged;
61 private String withDefault;
63 public WriterParametersBuilder() {
67 public WriterParametersBuilder setContent(final String content) {
68 this.content = content;
72 public WriterParametersBuilder setDepth(final int depth) {
77 public WriterParametersBuilder setFields(final List<Set<QName>> fields) {
82 public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
83 this.prettyPrint = prettyPrint;
87 public WriterParametersBuilder setWithDefault(final String withDefault) {
88 this.withDefault = withDefault;
92 public WriterParameters build() {
93 return new WriterParameters(this);
96 public void setTagged(final boolean tagged) {