BUG-7052: Move TopologicalSort to util package
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / util / NodeWrappedType.java
1 /*
2  * Copyright (c) 2014 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.parser.util;
9
10 import org.opendaylight.yangtools.yang.parser.util.TopologicalSort.NodeImpl;
11
12 /**
13  * @deprecated This class is not used anywhere and is scheduled for removal with TopologicalSort.
14  */
15 @Deprecated
16 public final class NodeWrappedType extends NodeImpl {
17     /**
18      * The payload which is saved inside Node
19      */
20     private final Object wrappedType;
21
22     /**
23      * Create new instance of class <code>NodeWrappedType</code>.
24      *
25      * @param wrappedType
26      *            object with payload data
27      */
28     public NodeWrappedType(final Object wrappedType) {
29         this.wrappedType = wrappedType;
30     }
31
32     /**
33      * Gets payload from class
34      *
35      * @return object with <code>wrappedType</code>
36      */
37     public Object getWrappedType() {
38         return wrappedType;
39     }
40
41     @Override
42     public boolean equals(final Object o) {
43         if (this == o) {
44             return true;
45         }
46         if (!(o instanceof NodeWrappedType)) {
47             return false;
48         }
49         NodeWrappedType nodeWrappedType = (NodeWrappedType) o;
50         if (!wrappedType.equals(nodeWrappedType.wrappedType)) {
51             return false;
52         }
53         return true;
54     }
55
56     @Override
57     public int hashCode() {
58         return wrappedType.hashCode();
59     }
60
61     @Override
62     public String toString() {
63         return "NodeWrappedType{" + "wrappedType=" + wrappedType + '}';
64     }
65
66 }