Fix checkstyle
[netconf.git] / restconf / restconf-common / src / main / java / org / opendaylight / restconf / common / context / WriterParameters.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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.common.context;
9
10 import java.util.List;
11 import java.util.Set;
12 import org.opendaylight.yangtools.yang.common.QName;
13
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;
21
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;
29     }
30
31     public String getContent() {
32         return this.content;
33     }
34
35     public Integer getDepth() {
36         return this.depth;
37     }
38
39     public List<Set<QName>> getFields() {
40         return this.fields;
41     }
42
43     public boolean isPrettyPrint() {
44         return this.prettyPrint;
45     }
46
47     public boolean isTagged() {
48         return this.tagged;
49     }
50
51     public String getWithDefault() {
52         return withDefault;
53     }
54
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;
62
63         public WriterParametersBuilder() {
64
65         }
66
67         public WriterParametersBuilder setContent(final String content) {
68             this.content = content;
69             return this;
70         }
71
72         public WriterParametersBuilder setDepth(final int depth) {
73             this.depth = depth;
74             return this;
75         }
76
77         public WriterParametersBuilder setFields(final List<Set<QName>> fields) {
78             this.fields = fields;
79             return this;
80         }
81
82         public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
83             this.prettyPrint = prettyPrint;
84             return this;
85         }
86
87         public WriterParametersBuilder setWithDefault(final String withDefault) {
88             this.withDefault = withDefault;
89             return this;
90         }
91
92         public WriterParameters build() {
93             return new WriterParameters(this);
94         }
95
96         public void setTagged(final boolean tagged) {
97             this.tagged = tagged;
98         }
99     }
100 }