@Test public void parentTriplesMapper_givenJoinConditions() { when(getIterator.get()).thenReturn(ImmutableList.of(entry)); when(expressionEvaluatorFactory.apply(entry)).thenReturn(evaluate); when(subjectGenerator.apply(evaluate)).thenReturn(ImmutableList.of(SKOS.CONCEPT)); ParentTriplesMapper<Object> mapper = new ParentTriplesMapper<>(subjectGenerator, getIterator, expressionEvaluatorFactory); Set<Resource> resources = mapper.map(joinValues); assertThat(resources.size(), is(1)); assertThat(SKOS.CONCEPT, is(in(resources))); }
Set<Resource> map(Set<Pair<String, Object>> joinValues) { if (joinValues.isEmpty()) { return ImmutableSet.of(); } Set<Resource> results = new LinkedHashSet<>(); getIterator.get().forEach(e -> map(e, joinValues) .forEach(results::add)); return results; }
ParentTriplesMapper { Set<Resource> map(Set<Pair<String, Object>> joinValues) { if (joinValues.isEmpty()) { return ImmutableSet.of(); } Set<Resource> results = new LinkedHashSet<>(); getIterator.get().forEach(e -> map(e, joinValues) .forEach(results::add)); return results; } }
ParentTriplesMapper { Set<Resource> map(Set<Pair<String, Object>> joinValues) { if (joinValues.isEmpty()) { return ImmutableSet.of(); } Set<Resource> results = new LinkedHashSet<>(); getIterator.get().forEach(e -> map(e, joinValues) .forEach(results::add)); return results; } ParentTriplesMapper(
		TermGenerator<Resource> subjectGenerator,
		TriplesMapperComponents<T> trMapperComponents
	);   ParentTriplesMapper(
		TermGenerator<Resource> subjectGenerator,
		Supplier<Iterable<T>> getIterator,
		LogicalSourceResolver.ExpressionEvaluatorFactory<T> expressionEvaluatorFactory
	); }
ParentTriplesMapper { Set<Resource> map(Set<Pair<String, Object>> joinValues) { if (joinValues.isEmpty()) { return ImmutableSet.of(); } Set<Resource> results = new LinkedHashSet<>(); getIterator.get().forEach(e -> map(e, joinValues) .forEach(results::add)); return results; } ParentTriplesMapper(
		TermGenerator<Resource> subjectGenerator,
		TriplesMapperComponents<T> trMapperComponents
	);   ParentTriplesMapper(
		TermGenerator<Resource> subjectGenerator,
		Supplier<Iterable<T>> getIterator,
		LogicalSourceResolver.ExpressionEvaluatorFactory<T> expressionEvaluatorFactory
	);  }
ParentTriplesMapper { Set<Resource> map(Set<Pair<String, Object>> joinValues) { if (joinValues.isEmpty()) { return ImmutableSet.of(); } Set<Resource> results = new LinkedHashSet<>(); getIterator.get().forEach(e -> map(e, joinValues) .forEach(results::add)); return results; } ParentTriplesMapper(
		TermGenerator<Resource> subjectGenerator,
		TriplesMapperComponents<T> trMapperComponents
	);   ParentTriplesMapper(
		TermGenerator<Resource> subjectGenerator,
		Supplier<Iterable<T>> getIterator,
		LogicalSourceResolver.ExpressionEvaluatorFactory<T> expressionEvaluatorFactory
	);   }