2 * Copyright (c) 2013 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
8 package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
10 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
11 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
12 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
13 import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableNormalizedNode;
15 public class ImmutableLeafNodeBuilder<T> extends AbstractImmutableNormalizedNodeBuilder<InstanceIdentifier.NodeIdentifier, T, LeafNode<T>> {
17 protected ImmutableLeafNodeBuilder() {
20 public static <T> NormalizedNodeBuilder<InstanceIdentifier.NodeIdentifier, T, LeafNode<T>> create() {
21 return new ImmutableLeafNodeBuilder<>();
25 public LeafNode<T> build() {
26 return new ImmutableLeafNode<>(nodeIdentifier, value);
29 static final class ImmutableLeafNode<T> extends AbstractImmutableNormalizedNode<InstanceIdentifier.NodeIdentifier, T> implements LeafNode<T> {
31 ImmutableLeafNode(InstanceIdentifier.NodeIdentifier nodeIdentifier, T value) {
32 super(nodeIdentifier, value);
36 public String toString() {
37 final StringBuffer sb = new StringBuffer("ImmutableLeafNode{");
38 sb.append("nodeIdentifier=").append(nodeIdentifier);
39 sb.append(", value=").append(value);