use of uk.gov.gchq.gaffer.rest.example.ExampleFilterFunction in project Gaffer by gchq.
the class ExamplesService method generateViewBuilder.
protected View.Builder generateViewBuilder() {
final View.Builder viewBuilder = new View.Builder();
if (hasEntities()) {
final ViewElementDefinition viewElement;
if (null == getAnEntityPropertyName()) {
viewElement = new ViewElementDefinition();
} else {
viewElement = new ViewElementDefinition.Builder().preAggregationFilter(new ElementFilter.Builder().select(getAnEntityPropertyName()).execute(new ExampleFilterFunction()).build()).build();
}
viewBuilder.entity(getAnEntityGroup(), viewElement);
}
if (hasEdges()) {
final ViewElementDefinition viewElement;
if (null == getAnEdgePropertyName()) {
viewElement = new ViewElementDefinition();
} else {
viewElement = new ViewElementDefinition.Builder().preAggregationFilter(new ElementFilter.Builder().select(getAnEdgePropertyName()).execute(new ExampleFilterFunction()).build()).build();
}
viewBuilder.edge(getAnEdgeGroup(), viewElement);
}
viewBuilder.globalElements(new GlobalViewElementDefinition.Builder().groupBy().build());
return viewBuilder;
}
Aggregations