2 * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
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
9 package org.opendaylight.nemo.tool.sandbox.models;
12 * Created by hj on 12/8/15.
14 public class Connector implements Comparable<Connector> {
15 private final int order;
16 private final String nodeName;
18 public Connector(String nodeName, int order) {
20 this.nodeName = nodeName;
23 public String getConnectorName() {
24 return nodeName + "-" + order;
27 public int getOrder() {
31 public String getNodeName() {
36 public boolean equals(Object o) {
37 if (this == o) return true;
38 if (o == null || getClass() != o.getClass()) return false;
40 Connector that = (Connector) o;
42 if (order != that.order) return false;
43 if (nodeName != null ? !nodeName.equals(that.nodeName) : that.nodeName != null)
50 public int hashCode() {
52 result = 31 * result + (nodeName != null ? nodeName.hashCode() : 0);
57 public String toString() {
58 return "SwitchInterface{" +
60 ", nodeName='" + nodeName + '\'' +
65 public int compareTo(Connector o) {
66 return order - o.order;