Move WriterParameters.tagged
[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 public class WriterParameters {
11     static final WriterParameters EMPTY = new WriterParametersBuilder().build();
12
13     private final Integer depth;
14     private final boolean prettyPrint;
15
16     protected WriterParameters(final WriterParametersBuilder builder) {
17         depth = builder.depth;
18         prettyPrint = builder.prettyPrint;
19     }
20
21     public Integer getDepth() {
22         return depth;
23     }
24
25     public boolean isPrettyPrint() {
26         return prettyPrint;
27     }
28
29     public static class WriterParametersBuilder {
30         private Integer depth;
31         private boolean prettyPrint;
32
33         public WriterParametersBuilder() {
34
35         }
36
37         public WriterParametersBuilder setDepth(final int depth) {
38             this.depth = depth;
39             return this;
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 }