We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Something like:
import java.util.Objects; import com.google.common.collect.ComparisonChain; public class Version implements Comparable<Version> { private final int major; private final int minor; private final int build; public Version(int major, int minor, int build) { this.major = major; this.minor = minor; this.build = build; } @Override public boolean equals(Object object) { return object instanceof Version && compareTo((Version) object) == 0; } @Override public int hashCode() { return Objects.hash(major, minor, build); } @Override public int compareTo(Version other) { return ComparisonChain.start() .compare(major, other.major) .compare(minor, other.minor) .compare(build, other.build) .result(); } }
Gives a HASHCHODE_HAS_MORE_FIELDS_THAN_EQUALS warning which is not correct.
HASHCHODE_HAS_MORE_FIELDS_THAN_EQUALS
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Something like:
Gives a
HASHCHODE_HAS_MORE_FIELDS_THAN_EQUALS
warning which is not correct.The text was updated successfully, but these errors were encountered: