45df2f191c62225baec226714542473de4da71aa
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / restconf / impl / WriterParameters.java
1 package org.opendaylight.controller.sal.restconf.impl;
2
3 import com.google.common.base.Optional;
4
5 public class WriterParameters {
6     private final Optional<Integer> depth;
7     private final boolean prettyPrint;
8
9     private WriterParameters(final WriterParametersBuilder builder) {
10         this.prettyPrint = builder.prettyPrint;
11         this.depth = builder.depth;
12     }
13
14     public Optional<Integer> getDepth() {
15         return depth;
16     }
17
18     public boolean isPrettyPrint() {
19         return prettyPrint;
20     }
21
22     public static class WriterParametersBuilder {
23         private Optional<Integer> depth = Optional.absent();
24         private boolean prettyPrint;
25
26         public WriterParametersBuilder() {
27         }
28
29         public Optional<Integer> getDepth() {
30             return depth;
31         }
32
33         public WriterParametersBuilder setDepth(final int depth) {
34             this.depth = Optional.of(depth);
35             return this;
36         }
37
38         public boolean isPrettyPrint() {
39             return prettyPrint;
40         }
41
42         public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
43             this.prettyPrint = prettyPrint;
44             return this;
45         }
46
47         public WriterParameters build() {
48             return new WriterParameters(this);
49         }
50     }
51 }
52