@Test @DisplayName("match Any instances") void matchAnyInstances() { Column column = anyColumn(); Any actualValue = anyValue(); ColumnName columnName = column.name(); EntityRecord record = Sample.messageOfType(EntityRecord.class); Map<ColumnName, Object> columns = singletonMap(columnName, actualValue); EntityRecordWithColumns recordWithColumns = createRecord(record, columns); Multimap<Column, Filter> filters = ImmutableMultimap.of(column, eq(columnName.value(), actualValue)); CompositeQueryParameter parameter = createParams(filters, ALL); QueryParameters parameters = QueryParameters.newBuilder() .add(parameter) .build(); EntityQuery<?> query = createQuery(emptySet(), parameters); EntityQueryMatcher<?> matcher = new EntityQueryMatcher<>(query); assertTrue(matcher.test(recordWithColumns)); }
@Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; }
EntityQueryMatcher implements Predicate<@Nullable EntityRecordWithColumns> { @Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; } }
EntityQueryMatcher implements Predicate<@Nullable EntityRecordWithColumns> { @Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; } EntityQueryMatcher(EntityQuery<I> query); }
EntityQueryMatcher implements Predicate<@Nullable EntityRecordWithColumns> { @Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; } EntityQueryMatcher(EntityQuery<I> query); @Override boolean test(@Nullable EntityRecordWithColumns input); }
EntityQueryMatcher implements Predicate<@Nullable EntityRecordWithColumns> { @Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; } EntityQueryMatcher(EntityQuery<I> query); @Override boolean test(@Nullable EntityRecordWithColumns input);  }