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
21     private WriterParameters(final WriterParametersBuilder builder) {
22         this.content = builder.content;
23         this.depth = builder.depth;
24         this.fields = builder.fields;
25         this.prettyPrint = builder.prettyPrint;
26         this.tagged = builder.tagged;
27     }
28
29     public String getContent() {
30         return this.content;
31     }
32
33     public Integer getDepth() {
34         return this.depth;
35     }
36
37     public List<Set<QName>> getFields() {
38         return this.fields;
39     }
40
41     public boolean isPrettyPrint() {
42         return this.prettyPrint;
43     }
44
45     public boolean isTagged() {
46         return this.tagged;
47     }
48
49     public static class WriterParametersBuilder {
50         private String content;
51         private Integer depth;
52         private List<Set<QName>> fields;
53         private boolean prettyPrint;
54         private boolean tagged;
55
56         public WriterParametersBuilder() {
57
58         }
59
60         public WriterParametersBuilder setContent(final String content) {
61             this.content = content;
62             return this;
63         }
64
65         public WriterParametersBuilder setDepth(final int depth) {
66             this.depth = depth;
67             return this;
68         }
69
70         public WriterParametersBuilder setFields(final List<Set<QName>> fields) {
71             this.fields = fields;
72             return this;
73         }
74
75         public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
76             this.prettyPrint = prettyPrint;
77             return this;
78         }
79
80         public WriterParameters build() {
81             return new WriterParameters(this);
82         }
83
84         public void setTagged(final boolean tagged) {
85             this.tagged = tagged;
86         }
87     }
88 }