Improve ServerConfigurationPayload.equals()
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / persisted / ServerConfigurationPayload.java
index 4843063647eb6cc1d881a745c82c3e51da6b3d4e..02cb6fa37e7f8521bd4e917fb3828cf89a57d39f 100644 (file)
@@ -121,20 +121,8 @@ public final class ServerConfigurationPayload extends Payload implements Persist
 
     @Override
     public boolean equals(final Object obj) {
-        if (this == obj) {
-            return true;
-        }
-
-        if (obj == null) {
-            return false;
-        }
-
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-
-        ServerConfigurationPayload other = (ServerConfigurationPayload) obj;
-        return serverConfig.equals(other.serverConfig);
+        return this == obj || obj instanceof ServerConfigurationPayload other
+            && serverConfig.equals(other.serverConfig);
     }
 
     @Override