Fix license header violations in sal-rest-connector
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / 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.controller.sal.restconf.impl;
10
11 import com.google.common.base.Optional;
12
13 public class WriterParameters {
14     private final Optional<Integer> depth;
15     private final boolean prettyPrint;
16
17     private WriterParameters(final WriterParametersBuilder builder) {
18         this.prettyPrint = builder.prettyPrint;
19         this.depth = builder.depth;
20     }
21
22     public Optional<Integer> getDepth() {
23         return depth;
24     }
25
26     public boolean isPrettyPrint() {
27         return prettyPrint;
28     }
29
30     public static class WriterParametersBuilder {
31         private Optional<Integer> depth = Optional.absent();
32         private boolean prettyPrint;
33
34         public WriterParametersBuilder() {
35         }
36
37         public Optional<Integer> getDepth() {
38             return depth;
39         }
40
41         public WriterParametersBuilder setDepth(final int depth) {
42             this.depth = Optional.of(depth);
43             return this;
44         }
45
46         public boolean isPrettyPrint() {
47             return prettyPrint;
48         }
49
50         public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
51             this.prettyPrint = prettyPrint;
52             return this;
53         }
54
55         public WriterParameters build() {
56             return new WriterParameters(this);
57         }
58     }
59 }
60