X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconnectionmanager%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconnectionmanager%2Fscheme%2FAbstractScheme.java;h=68d1b233b2ebe7c71663f4341983a98e9938ccc1;hb=5aa8f995feede44d69bc26e70a67e6c44b01c758;hp=718a3ff166e1a7ae72cae6175da0aaef12542e4c;hpb=1993a259ac7f42767064d9a5c5e2dcef91e8333d;p=controller.git diff --git a/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/AbstractScheme.java b/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/AbstractScheme.java index 718a3ff166..68d1b233b2 100644 --- a/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/AbstractScheme.java +++ b/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/AbstractScheme.java @@ -1,3 +1,10 @@ +/* + * 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.controller.connectionmanager.scheme; import java.net.InetAddress; @@ -47,7 +54,7 @@ public abstract class AbstractScheme { allocateCaches(); retrieveCaches(); } else { - log.error("Couldn't retrieve caches for scheme %s. Clustering service unavailable", name); + log.error("Couldn't retrieve caches for scheme {}. Clustering service unavailable", name); } } @@ -328,4 +335,56 @@ public abstract class AbstractScheme { log.error("An error occured",e); } } + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((nodeConnections == null) ? 0 : nodeConnections.hashCode()); + result = prime * result + ((nodeConnectionsCacheName == null) ? 0 : nodeConnectionsCacheName.hashCode()); + return result; + } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof AbstractScheme)) { + return false; + } + AbstractScheme other = (AbstractScheme) obj; + if (name == null) { + if (other.name != null) { + return false; + } + } else if (!name.equals(other.name)) { + return false; + } + if (nodeConnections == null) { + if (other.nodeConnections != null) { + return false; + } + } else if (!nodeConnections.equals(other.nodeConnections)) { + return false; + } + if (nodeConnectionsCacheName == null) { + if (other.nodeConnectionsCacheName != null) { + return false; + } + } else if (!nodeConnectionsCacheName.equals(other.nodeConnectionsCacheName)) { + return false; + } + return true; + } }