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.netconf.sal.restconf.impl;
11 import com.google.common.base.Optional;
13 public class WriterParameters {
14 private final String content;
15 private final Optional<Integer> depth;
16 private final boolean prettyPrint;
18 private WriterParameters(final WriterParametersBuilder builder) {
19 this.content = builder.content;
20 this.depth = builder.depth;
21 this.prettyPrint = builder.prettyPrint;
24 public String getContent() {
28 public Optional<Integer> getDepth() {
32 public boolean isPrettyPrint() {
36 public static class WriterParametersBuilder {
37 private String content;
38 private Optional<Integer> depth = Optional.absent();
39 private boolean prettyPrint;
41 public WriterParametersBuilder() {}
43 public WriterParametersBuilder setContent(final String content) {
44 this.content = content;
48 public WriterParametersBuilder setDepth(final int depth) {
49 this.depth = Optional.of(depth);
53 public WriterParametersBuilder setPrettyPrint(final boolean prettyPrint) {
54 this.prettyPrint = prettyPrint;
58 public WriterParameters build() {
59 return new WriterParameters(this);