9d576c466f0c5f1a6a19c22e06f0804195b0046d
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / netconf / sal / restconf / impl / 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
9 package org.opendaylight.netconf.sal.restconf.impl;
10
11 import java.util.List;
12 import java.util.Set;
13 import org.opendaylight.yangtools.yang.common.QName;
14
15 public class WriterParameters {
16     private final String content;
17     private final Integer depth;
18     private final List<Set<QName>> fields;
19     private final boolean prettyPrint;
20     private final boolean tagged;
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     }
29
30     public String getContent() {
31         return this.content;
32     }
33
34     public Integer getDepth() {
35         return this.depth;
36     }
37
38     public List<Set<QName>> getFields() {
39         return this.fields;
40     }
41
42     public boolean isPrettyPrint() {
43         return this.prettyPrint;
44     }
45
46     public boolean isTagged() {
47         return this.tagged;
48     }
49
50     public static class WriterParametersBuilder {
51         private String content;
52         private Integer depth;
53         private List<Set<QName>> fields;
54         private boolean prettyPrint;
55         private boolean tagged;
56
57         public WriterParametersBuilder() {}
58
59         public WriterParametersBuilder setContent(final String content) {
60             this.content = content;
61             return this;
62         }
63
64         public WriterParametersBuilder setDepth(final int depth) {
65             this.depth = depth;
66             return this;
67         }
68
69         public WriterParametersBuilder setFields(final List<Set<QName>> fields) {
70             this.fields = fields;
71             return this;
72         }
73
74         public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
75             this.prettyPrint = prettyPrint;
76             return this;
77         }
78
79         public WriterParameters build() {
80             return new WriterParameters(this);
81         }
82
83         public void setTagged(final boolean tagged) {
84             this.tagged = tagged;
85         }
86     }
87 }