Reduce cyclomatic complexity
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / RangeConstraintImpl.java
index f8db0870528abaa1cd85efdf79da137b9f359d3d..2bf3b32ddb8a31a2c2fbb9c309e353e8da7771d1 100644 (file)
@@ -96,26 +96,12 @@ final class RangeConstraintImpl implements RangeConstraint, Immutable {
         if (this == obj) {
             return true;
         }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
+        if (!(obj instanceof RangeConstraintImpl)) {
             return false;
         }
         final RangeConstraintImpl other = (RangeConstraintImpl) obj;
-        if (!Objects.equals(description, other.description)) {
-            return false;
-        }
-        if (!Objects.equals(max, other.max)) {
-            return false;
-        }
-        if (!Objects.equals(min, other.min)) {
-            return false;
-        }
-        if (!Objects.equals(reference, other.reference)) {
-            return false;
-        }
-        return true;
+        return Objects.equals(description, other.description) && Objects.equals(max, other.max)
+                && Objects.equals(min, other.min) && Objects.equals(reference, other.reference);
     }
 
     @Override