public interface HashingStrategy<T>
| Modifier and Type | Field and Description |
|---|---|
static HashingStrategy |
JAVA_HASHER
一个 HashingStrategy ,它代表java的Object.hashCode()和Object.equals(Object) 。
|
static final HashingStrategy JAVA_HASHER
HashingStrategy代表java的Object.hashCode()和Object.equals(Object) 。
int hashCode(T obj)
obj的哈希码。
此方法必须遵守Object.hashCode()与Object.equals(Object)具有的相同关系:
obj多次调用此方法应返回相同的结果 equals(Object, Object)与参数a和b回报true则此方法参数的返回值a和b必须返回相同的结果 equals(Object, Object)与参数a和b回报false则此方法参数的返回值a和b 不必返回不同的结果的结果。 然而这个属性是可取的。 obj是null那么此方法返回0 boolean equals(T a, T b)
true if the arguments are equal to each other and
false otherwise. This method has the following restrictions:
equals(a, a) should return trueequals(a, b) returns true iff equals(b, a) returns trueequals(a, b) returns true and equals(a, c) returns true then equals(b, c) should also return trueequals(a, b) should return the same result when called multiple times assuming a and b remain unchanged relative to the comparison criteriaa and b are both null then this method returns truea is null and b is non-null, or a is non-null and b is null then this method returns falseCopyright © 2008–2018 The Netty Project. All rights reserved.