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.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
13 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
14 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
16 @Deprecated(since = "6.0.7", forRemoval = true)
17 public final class ImmutableLeafNodeSchemaAwareBuilder<T> extends ImmutableLeafNodeBuilder<T> {
18 private ImmutableLeafNodeSchemaAwareBuilder(final LeafSchemaNode schema) {
19 super.withNodeIdentifier(NodeIdentifier.create(schema.getQName()));
22 public static <T> @NonNull NormalizedNodeBuilder<NodeIdentifier, T, LeafNode<T>> create(
23 final LeafSchemaNode schema) {
24 return new ImmutableLeafNodeSchemaAwareBuilder<>(schema);
28 public NormalizedNodeBuilder<NodeIdentifier, T, LeafNode<T>> withValue(final T withValue) {
29 // TODO: check value type
30 return super.withValue(withValue);
34 public NormalizedNodeBuilder<NodeIdentifier, T, LeafNode<T>> withNodeIdentifier(
35 final NodeIdentifier withNodeIdentifier) {
36 throw new UnsupportedOperationException("Node identifier created from schema");