Skip to content

Instantly share code, notes, and snippets.

@linnykoleh
Created March 29, 2017 04:52
Show Gist options
  • Save linnykoleh/113aae3eeee199964e2a21f6087f7320 to your computer and use it in GitHub Desktop.
Save linnykoleh/113aae3eeee199964e2a21f6087f7320 to your computer and use it in GitHub Desktop.
public class GoodKey {
private String a;
private String b;
public GoodKey(String a, String b) {
this.a = a;
this.b = b;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoodKey that = (GoodKey) o;
return Objects.equals(that.a, this.a) && Objects.equals(that.b, this.b);
}
@Override
public int hashCode() {
return Objects.hash(a, b);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment