Simplify BagOfPrimitives if statement (#1539)
* Simplify BagOfPrimitives if statement * formatting
This commit is contained in:
parent
49d8630978
commit
aa236ec38d
|
@ -66,25 +66,18 @@ public class BagOfPrimitives {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj) return true;
|
||||||
return true;
|
if (obj == null) return false;
|
||||||
if (obj == null)
|
if (getClass() != obj.getClass()) return false;
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
BagOfPrimitives other = (BagOfPrimitives) obj;
|
BagOfPrimitives other = (BagOfPrimitives) obj;
|
||||||
if (booleanValue != other.booleanValue)
|
if (booleanValue != other.booleanValue) return false;
|
||||||
return false;
|
if (intValue != other.intValue) return false;
|
||||||
if (intValue != other.intValue)
|
if (longValue != other.longValue) return false;
|
||||||
return false;
|
|
||||||
if (longValue != other.longValue)
|
|
||||||
return false;
|
|
||||||
if (stringValue == null) {
|
if (stringValue == null) {
|
||||||
if (other.stringValue != null)
|
return other.stringValue == null;
|
||||||
return false;
|
} else {
|
||||||
} else if (!stringValue.equals(other.stringValue))
|
return stringValue.equals(other.stringValue);
|
||||||
return false;
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user