本文整理了Java中org.assertj.core.util.Objects.hashCodeFor()
方法的一些代码示例,展示了Objects.hashCodeFor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Objects.hashCodeFor()
方法的具体详情如下:
包路径:org.assertj.core.util.Objects
类名称:Objects
方法名:hashCodeFor
[英]Returns the hash code for the given object. If the object is null, this method returns zero. Otherwise calls the method hashCode of the given object.
[中]返回给定对象的哈希代码。如果对象为null,则此方法返回零。否则调用给定对象的hashCode方法。
代码示例来源:origin: org.assertj/assertj-core
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(actual);
result = HASH_CODE_PRIME * result + hashCodeFor(expected);
return result;
}
代码示例来源:origin: org.assertj/assertj-core
@Override
public int hashCode() {
return HASH_CODE_PRIME * hashCodeFor(description);
}
}
代码示例来源:origin: org.assertj/assertj-core
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(value);
return result;
}
代码示例来源:origin: org.assertj/assertj-core
@Override
public int hashCode() {
return HASH_CODE_PRIME + hashCodeFor(value) + hashCodeFor(args);
}
代码示例来源:origin: joel-costigliola/assertj-core
@Override
public int hashCode() {
return HASH_CODE_PRIME * hashCodeFor(description);
}
}
代码示例来源:origin: joel-costigliola/assertj-core
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(value);
return result;
}
代码示例来源:origin: joel-costigliola/assertj-core
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(actual);
result = HASH_CODE_PRIME * result + hashCodeFor(expected);
return result;
}
代码示例来源:origin: joel-costigliola/assertj-core
@Override
public int hashCode() {
return HASH_CODE_PRIME + hashCodeFor(value) + hashCodeFor(args);
}
代码示例来源:origin: square/assertj-android
@Override public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(key);
result = HASH_CODE_PRIME * result + hashCodeFor(value);
return result;
}
代码示例来源:origin: org.assertj/assertj-core
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(format);
result = HASH_CODE_PRIME * result + Arrays.hashCode(arguments);
return result;
}
代码示例来源:origin: org.assertj/assertj-core
@Override
protected Set<Object> newSetUsingComparisonStrategy() {
// define a comparator so that we can use areEqual to compare objects in Set collections
// the "less than" comparison does not make much sense here but need to be defined.
return new TreeSet<>((o1, o2) -> {
if (areEqual(o1, o2)) return 0;
return Objects.hashCodeFor(o1) < Objects.hashCodeFor(o2) ? -1 : 1;
});
}
代码示例来源:origin: joel-costigliola/assertj-core
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(format);
result = HASH_CODE_PRIME * result + Arrays.hashCode(arguments);
return result;
}
代码示例来源:origin: joel-costigliola/assertj-core
@Override
protected Set<Object> newSetUsingComparisonStrategy() {
// define a comparator so that we can use areEqual to compare objects in Set collections
// the "less than" comparison does not make much sense here but need to be defined.
return new TreeSet<>((o1, o2) -> {
if (areEqual(o1, o2)) return 0;
return Objects.hashCodeFor(o1) < Objects.hashCodeFor(o2) ? -1 : 1;
});
}
代码示例来源:origin: org.assertj/assertj-guava
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(key);
result = HASH_CODE_PRIME * result + hashCodeFor(value);
return result;
}
代码示例来源:origin: org.assertj/assertj-swing-junit
/**
* Returns the hash code of this attribute, based on its name and value.
*
* @return the hash code of this attribute.
*/
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(name);
result = HASH_CODE_PRIME * result + hashCodeFor(value);
return result;
}
代码示例来源:origin: joel-costigliola/assertj-swing
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(attributes);
return result;
}
代码示例来源:origin: org.assertj/assertj-core-java8
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(value);
return result;
}
代码示例来源:origin: org.assertj/assertj-core-java8
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(key);
result = HASH_CODE_PRIME * result + hashCodeFor(value);
return result;
}
代码示例来源:origin: org.assertj/assertj-core-java8
@Override
public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(format);
result = HASH_CODE_PRIME * result + Arrays.hashCode(arguments);
return result;
}
代码示例来源:origin: org.assertj/assertj-core-java8
@Override
public int compare(Object o1, Object o2) {
if (areEqual(o1, o2)) return 0;
return Objects.hashCodeFor(o1) < Objects.hashCodeFor(o2) ? -1 : 1;
}
});
内容来源于网络,如有侵权,请联系作者删除!