2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.sal.restconf.impl;
11 import com.google.common.base.Optional;
13 public class WriterParameters {
14 private final Optional<Integer> depth;
15 private final boolean prettyPrint;
17 private WriterParameters(final WriterParametersBuilder builder) {
18 this.prettyPrint = builder.prettyPrint;
19 this.depth = builder.depth;
22 public Optional<Integer> getDepth() {
26 public boolean isPrettyPrint() {
30 public static class WriterParametersBuilder {
31 private Optional<Integer> depth = Optional.absent();
32 private boolean prettyPrint;
34 public WriterParametersBuilder() {
37 public Optional<Integer> getDepth() {
41 public WriterParametersBuilder setDepth(final int depth) {
42 this.depth = Optional.of(depth);
46 public boolean isPrettyPrint() {
50 public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
51 this.prettyPrint = prettyPrint;
55 public WriterParameters build() {
56 return new WriterParameters(this);