We can use an instanceof pattern, squashing logic accordingly.
Change-Id: Ice925cc99d90b1c918ce17cfdc987275db932381
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
@Override
public boolean equals(final Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof ActionSpec)) {
- return false;
- }
- final var other = (ActionSpec<?, ?>) obj;
- return type.equals(other.type) && path.equals(other.path);
+ return obj == this || obj instanceof ActionSpec<?, ?> other
+ && type.equals(other.type) && path.equals(other.path);
}
@Override