Deprecate schema-aware builders
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / ImmutableLeafNodeSchemaAwareBuilder.java
index 5ded713cfe3a07b7ce567643ca4d0ce8e839de7d..21145865bb1fb7aedbb0059d05913d9e3ce7c15f 100644 (file)
@@ -7,29 +7,32 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
 
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 
+@Deprecated(since = "6.0.7", forRemoval = true)
 public final class ImmutableLeafNodeSchemaAwareBuilder<T> extends ImmutableLeafNodeBuilder<T> {
-
-    private ImmutableLeafNodeSchemaAwareBuilder(LeafSchemaNode schema) {
-        super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName()));
+    private ImmutableLeafNodeSchemaAwareBuilder(final LeafSchemaNode schema) {
+        super.withNodeIdentifier(NodeIdentifier.create(schema.getQName()));
     }
 
-    public static <T> NormalizedNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, T, LeafNode<T>> create(LeafSchemaNode schema) {
+    public static <T> @NonNull NormalizedNodeBuilder<NodeIdentifier, T, LeafNode<T>> create(
+            final LeafSchemaNode schema) {
         return new ImmutableLeafNodeSchemaAwareBuilder<>(schema);
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, T, LeafNode<T>> withValue(T value) {
-//        TODO check value type
-        return super.withValue(value);
+    public NormalizedNodeBuilder<NodeIdentifier, T, LeafNode<T>> withValue(final T withValue) {
+        // TODO: check value type
+        return super.withValue(withValue);
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, T, LeafNode<T>> withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier nodeIdentifier) {
+    public NormalizedNodeBuilder<NodeIdentifier, T, LeafNode<T>> withNodeIdentifier(
+            final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 }