Files
openide/plugins/lombok/testData/after/equalsandhashcode/EqualsAndHashCodeWithGenericsOnInnersInInterfaces.java
Michail Plushnikov 1a49f1d331 added basic support for Include/Exclude #504
added new test classes from lombok
make code generation for equals and hashCode more lombok like

GitOrigin-RevId: 3765b27a943fc03fbab6af9d80e03dbd35f1249e
2018-10-20 16:13:05 +03:00

28 lines
897 B
Java

public interface EqualsAndHashCodeWithGenericsOnInnersInInterfaces<A> {
class Inner<B> {
int x;
@Override
@SuppressWarnings("all")
public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof EqualsAndHashCodeWithGenericsOnInnersInInterfaces.Inner)) return false;
final EqualsAndHashCodeWithGenericsOnInnersInInterfaces.Inner<?> other = (EqualsAndHashCodeWithGenericsOnInnersInInterfaces.Inner<?>) o;
if (!other.canEqual((Object) this)) return false;
if (this.x != other.x) return false;
return true;
}
@SuppressWarnings("all")
protected boolean canEqual(final Object other) {
return other instanceof EqualsAndHashCodeWithGenericsOnInnersInInterfaces.Inner;
}
@Override
@SuppressWarnings("all")
public int hashCode() {
final int PRIME = 59;
int result = 1;
result = result * PRIME + this.x;
return result;
}
}
}