org.assertj.core.internal.Objects.isEqualToComparingOnlyGivenFields()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.assertj.core.internal.Objects.isEqualToComparingOnlyGivenFields()方法的一些代码示例,展示了Objects.isEqualToComparingOnlyGivenFields()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Objects.isEqualToComparingOnlyGivenFields()方法的具体详情如下:
包路径:org.assertj.core.internal.Objects
类名称:Objects
方法名:isEqualToComparingOnlyGivenFields

Objects.isEqualToComparingOnlyGivenFields介绍

暂无

代码示例

代码示例来源:origin: org.assertj/assertj-core

public boolean areEqualToComparingOnlyGivenFields(Object actual, Object other,
                         Map<String, Comparator<?>> comparatorByPropertyOrField,
                         TypeComparators comparatorByType, String... fields) {
 return isEqualToComparingOnlyGivenFields(actual, other, comparatorByPropertyOrField, comparatorByType,
                      fields).isFieldsNamesEmpty();
}

代码示例来源:origin: joel-costigliola/assertj-core

public boolean areEqualToComparingOnlyGivenFields(Object actual, Object other,
                         Map<String, Comparator<?>> comparatorByPropertyOrField,
                         TypeComparators comparatorByType, String... fields) {
 return isEqualToComparingOnlyGivenFields(actual, other, comparatorByPropertyOrField, comparatorByType,
                      fields).isFieldsNamesEmpty();
}

代码示例来源:origin: org.assertj/assertj-core

String... fields) {
assertNotNull(info, actual);
ByFieldsComparison byFieldsComparison = isEqualToComparingOnlyGivenFields(actual, other,
                                     comparatorByPropertyOrField,
                                     comparatorByType,

代码示例来源:origin: joel-costigliola/assertj-core

String... fields) {
assertNotNull(info, actual);
ByFieldsComparison byFieldsComparison = isEqualToComparingOnlyGivenFields(actual, other,
                                     comparatorByPropertyOrField,
                                     comparatorByType,

代码示例来源:origin: org.assertj/assertj-core-java8

public boolean areEqualToComparingOnlyGivenFields(Object actual, Object other, String... fields) {
 return isEqualToComparingOnlyGivenFields(actual, other, fields).isFieldsNamesEmpty();
}

代码示例来源:origin: org.assertj/assertj-core-java8

/**
 * Assert that the given object is lenient equals to other object by comparing given fields value only.
 *
 * @param info contains information about the assertion.
 * @param actual the given object.
 * @param other the object to compare {@code actual} to.
 * @param fields accepted fields
 * @throws NullPointerException if the other type is {@code null}.
 * @throws AssertionError if actual is {@code null}.
 * @throws AssertionError if the actual and the given object are not lenient equals.
 * @throws AssertionError if the other object is not an instance of the actual type.
 * @throws IntrospectionError if a field does not exist in actual.
 */
public <A> void assertIsEqualToComparingOnlyGivenFields(AssertionInfo info, A actual, A other, String... fields) {
 assertNotNull(info, actual);
 assertOtherTypeIsCompatibleWithActualClass(info, other, actual.getClass());
 ByFieldsComparison byFieldsComparison = isEqualToComparingOnlyGivenFields(actual, other, fields);
 if (byFieldsComparison.isFieldsNamesNotEmpty())
  throw failures.failure(info, shouldBeEqualComparingOnlyGivenFields(actual, byFieldsComparison.fieldsNames,
                                    byFieldsComparison.rejectedValues,
                                    byFieldsComparison.expectedValues,
                                    newArrayList(fields)));
}

相关文章

微信公众号

最新文章

更多