Guava Method Precedes Java 7.
A Java method with the same name takes only one argument. But sibling java.util.Objects.hash()
takes a variable number of arguments, like Guava Objects.hashCode()
.
If you are using Java 7 or later, you can use java.util.Objects.hash(...)
. Guava documentation notes the following:
Note for Java 7 and later: this method should be considered deprecated; use Objects.hash (java.lang.Object ...) instead.
If you are using Java 6 or earlier, you can use the Guava method.
source share