Merge "Introduce Identifiables"
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / ImmutableAnyXmlNodeBuilder.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.yangtools.yang.data.impl.schema.builder.impl;
9
10 import java.util.Map;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
13 import org.opendaylight.yangtools.yang.data.api.Node;
14 import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode;
15 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder;
16 import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableNormalizedValueAttrNode;
17
18 public class ImmutableAnyXmlNodeBuilder extends AbstractImmutableNormalizedNodeBuilder<InstanceIdentifier.NodeIdentifier, Node<?>, AnyXmlNode> {
19
20     public static NormalizedNodeAttrBuilder<InstanceIdentifier.NodeIdentifier, Node<?>, AnyXmlNode> create() {
21         return new ImmutableAnyXmlNodeBuilder();
22     }
23
24     @Override
25     public AnyXmlNode build() {
26         return new ImmutableXmlNode(getNodeIdentifier(), getValue(), getAttributes());
27     }
28
29     private static final class ImmutableXmlNode extends AbstractImmutableNormalizedValueAttrNode<InstanceIdentifier.NodeIdentifier, Node<?>> implements AnyXmlNode {
30
31         ImmutableXmlNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, final Node<?> value, final Map<QName, String> attributes) {
32             super(nodeIdentifier, value, attributes);
33         }
34     }
35 }