Remove netconf from commons/opendaylight pom
[controller.git] / opendaylight / netconf / tools / netconf-cli / src / main / java / org / opendaylight / controller / netconf / cli / writer / impl / LeafSetEntryNodeCliSerializer.java
1 /*
2  * Copyright (c) 2013 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.controller.netconf.cli.writer.impl;
9
10 import org.opendaylight.controller.netconf.cli.writer.OutFormatter;
11 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
12 import org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializer.LeafSetEntryNodeBaseSerializer;
13 import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
14
15 final class LeafSetEntryNodeCliSerializer extends LeafSetEntryNodeBaseSerializer<String> {
16
17     private final OutFormatter out;
18
19     public LeafSetEntryNodeCliSerializer(final OutFormatter out) {
20         this.out = out;
21     }
22
23     @Override
24     protected String serializeLeaf(final LeafListSchemaNode schema, final LeafSetEntryNode<?> node) {
25         final StringBuilder output = new StringBuilder();
26         out.increaseIndent();
27         out.addStringWithIndent(output, node.getValue().toString());
28         out.decreaseIndent();
29         return output.toString();
30     }
31 }