Use Objects.equals()
[mdsal.git] / binding / mdsal-binding-generator-util / src / main / java / org / opendaylight / yangtools / binding / generator / util / generated / type / builder / ConstantImpl.java
index 081ea21b5a3c9c9284efd405695c96ab5879850c..920d4eb9ac6182f24f33700d1a6abef01f4f6b4f 100644 (file)
@@ -59,7 +59,7 @@ final class ConstantImpl implements Constant {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see java.lang.Object#hashCode()
      */
     @Override
@@ -73,11 +73,11 @@ final class ConstantImpl implements Constant {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see java.lang.Object#equals(java.lang.Object)
      */
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if (this == obj) {
             return true;
         }
@@ -88,28 +88,7 @@ final class ConstantImpl implements Constant {
             return false;
         }
         ConstantImpl other = (ConstantImpl) obj;
-        if (name == null) {
-            if (other.name != null) {
-                return false;
-            }
-        } else if (!name.equals(other.name)) {
-            return false;
-        }
-        if (type == null) {
-            if (other.type != null) {
-                return false;
-            }
-        } else if (!type.equals(other.type)) {
-            return false;
-        }
-        if (value == null) {
-            if (other.value != null) {
-                return false;
-            }
-        } else if (!value.equals(other.value)) {
-            return false;
-        }
-        return true;
+        return Objects.equals(name, other.name) && Objects.equals(type, other.type) && Objects.equals(value, other.value);
     }
 
     @Override