Move a few more tests
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / yang / types / 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.mdsal.binding.yang.types;
9
10 import org.opendaylight.yangtools.util.TopologicalSort.NodeImpl;
11
12 final class NodeWrappedType extends NodeImpl {
13     /**
14      * The payload which is saved inside Node.
15      */
16     private final Object wrappedType;
17
18     /**
19      * Create new instance of class <code>NodeWrappedType</code>.
20      *
21      * @param wrappedType object with payload data
22      */
23     NodeWrappedType(final Object wrappedType) {
24         this.wrappedType = wrappedType;
25     }
26
27     /**
28      * Gets payload from class.
29      *
30      * @return object with <code>wrappedType</code>
31      */
32     Object getWrappedType() {
33         return wrappedType;
34     }
35
36     @Override
37     public boolean equals(final Object obj) {
38         if (this == obj) {
39             return true;
40         }
41         if (!(obj instanceof NodeWrappedType)) {
42             return false;
43         }
44         NodeWrappedType nodeWrappedType = (NodeWrappedType) obj;
45         return wrappedType.equals(nodeWrappedType.wrappedType);
46     }
47
48     @Override
49     public int hashCode() {
50         return wrappedType.hashCode();
51     }
52
53     @Override
54     public String toString() {
55         return "NodeWrappedType{" + "wrappedType=" + wrappedType + '}';
56     }
57 }