Created
March 29, 2017 04:52
-
-
Save linnykoleh/113aae3eeee199964e2a21f6087f7320 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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