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 static java.util.Objects.requireNonNull;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
14 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
15 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
16 import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
18 @Deprecated(since = "6.0.7", forRemoval = true)
19 public final class ImmutableLeafSetEntryNodeSchemaAwareBuilder<T> extends ImmutableLeafSetEntryNodeBuilder<T> {
20 private final LeafListSchemaNode schema;
22 private ImmutableLeafSetEntryNodeSchemaAwareBuilder(final LeafListSchemaNode schema) {
23 this.schema = requireNonNull(schema);
26 public static <T> @NonNull NormalizedNodeBuilder<NodeWithValue, T, LeafSetEntryNode<T>> create(
27 final LeafListSchemaNode schema) {
28 return new ImmutableLeafSetEntryNodeSchemaAwareBuilder<>(schema);
32 public NormalizedNodeBuilder<NodeWithValue, T, LeafSetEntryNode<T>> withValue(final T withValue) {
33 super.withNodeIdentifier(new NodeWithValue<>(schema.getQName(), withValue));
34 // TODO check value type using TypeProvider ?
35 return super.withValue(withValue);
39 public NormalizedNodeBuilder<NodeWithValue, T, LeafSetEntryNode<T>> withNodeIdentifier(
40 final NodeWithValue withNodeIdentifier) {
41 throw new UnsupportedOperationException("Node identifier created from schema");