Eliminate yang.data.spi.tree
[yangtools.git] / data / yang-data-spi / src / main / java / org / opendaylight / yangtools / yang / data / spi / tree / TreeNodeFactory.java
diff --git a/data/yang-data-spi/src/main/java/org/opendaylight/yangtools/yang/data/spi/tree/TreeNodeFactory.java b/data/yang-data-spi/src/main/java/org/opendaylight/yangtools/yang/data/spi/tree/TreeNodeFactory.java
deleted file mode 100644 (file)
index 9c60234..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.data.spi.tree;
-
-import org.opendaylight.yangtools.yang.data.api.schema.DistinctNodeContainer;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.api.schema.OrderedNodeContainer;
-
-/**
- * Public entrypoint for other packages. Allows instantiating a tree node
- * with specified version.
- */
-public final class TreeNodeFactory {
-    private TreeNodeFactory() {
-        // Hidden on purpose
-    }
-
-    /**
-     * Create a new AbstractTreeNode from a data node.
-     *
-     * @param data data node
-     * @param version data node version
-     * @return new AbstractTreeNode instance, covering the data tree provided
-     */
-    public static TreeNode createTreeNode(final NormalizedNode data, final Version version) {
-        if (data instanceof DistinctNodeContainer) {
-            @SuppressWarnings("unchecked")
-            final DistinctNodeContainer<?, NormalizedNode> container = (DistinctNodeContainer<?, NormalizedNode>) data;
-            return new SimpleContainerNode(container, version);
-        } else if (data instanceof OrderedNodeContainer) {
-            return new SimpleContainerNode(data, version);
-        } else {
-            return new ValueNode(data, version);
-        }
-    }
-}