Created
November 25, 2013 08:05
-
-
Save yanhua365/7637974 to your computer and use it in GitHub Desktop.
用IntelliJ IDEA生成的equals和hashCode方法
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
@Override | |
public boolean equals(Object o) { | |
if (this == o) return true; | |
if (o == null || getClass() != o.getClass()) return false; | |
UpdateConfig that = (UpdateConfig) o; | |
if (!fromVersion.equals(that.fromVersion)) return false; | |
if (!targetVersion.equals(that.targetVersion)) return false; | |
return true; | |
} | |
@Override | |
public int hashCode() { | |
int result = targetVersion.hashCode(); | |
result = 31 * result + fromVersion.hashCode(); | |
return result; | |
} |
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
@Override | |
public boolean equals(Object o) { | |
if (this == o) return true; | |
if (o == null || getClass() != o.getClass()) return false; | |
UpdateConfig that = (UpdateConfig) o; | |
if (fromVersion != null ? !fromVersion.equals(that.fromVersion) : that.fromVersion != null) return false; | |
if (targetVersion != null ? !targetVersion.equals(that.targetVersion) : that.targetVersion != null) | |
return false; | |
return true; | |
} | |
@Override | |
public int hashCode() { | |
int result = targetVersion != null ? targetVersion.hashCode() : 0; | |
result = 31 * result + (fromVersion != null ? fromVersion.hashCode() : 0); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment