Renderer and OLM update
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / NodeIdPair.java
1 /*
2  * Copyright © 2017 AT&T 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.transportpce.renderer;
9
10 public class NodeIdPair {
11
12     private String nodeID;
13     private String tpID;
14
15     public NodeIdPair(String nodeID, String tpID) {
16         this.nodeID = nodeID;
17         this.tpID = tpID;
18     }
19
20     public String getNodeID() {
21         return this.nodeID;
22     }
23
24     public String getTpID() {
25         return this.tpID;
26     }
27
28     @Override
29     public boolean equals(Object object) {
30         if (this == object) {
31             return true;
32         }
33         if ((object == null) || (getClass() != object.getClass())) {
34             return false;
35         }
36
37         NodeIdPair that = (NodeIdPair) object;
38
39         if (this.nodeID != null ? !this.nodeID.equals(that.nodeID) : that.nodeID != null) {
40             return false;
41         }
42         return this.tpID != null ? this.tpID.equals(that.tpID) : that.tpID == null;
43     }
44
45     @Override
46     public int hashCode() {
47         int result = this.nodeID != null ? this.nodeID.hashCode() : 0;
48         result = (31 * result) + (this.tpID != null ? this.tpID.hashCode() : 0);
49         return result;
50     }
51
52     @Override
53     public String toString() {
54         return "NodeIdPair{" + "nodeID='" + this.nodeID + '\'' + ", tpID='" + this.tpID + '\'' + '}';
55     }
56 }