Search in sources :

Example 1 with ExampleFilterFunction

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;
}
Also used : GlobalViewElementDefinition(uk.gov.gchq.gaffer.data.elementdefinition.view.GlobalViewElementDefinition) ViewElementDefinition(uk.gov.gchq.gaffer.data.elementdefinition.view.ViewElementDefinition) ExampleFilterFunction(uk.gov.gchq.gaffer.rest.example.ExampleFilterFunction) GlobalViewElementDefinition(uk.gov.gchq.gaffer.data.elementdefinition.view.GlobalViewElementDefinition) View(uk.gov.gchq.gaffer.data.elementdefinition.view.View)

Aggregations

GlobalViewElementDefinition (uk.gov.gchq.gaffer.data.elementdefinition.view.GlobalViewElementDefinition)1 View (uk.gov.gchq.gaffer.data.elementdefinition.view.View)1 ViewElementDefinition (uk.gov.gchq.gaffer.data.elementdefinition.view.ViewElementDefinition)1 ExampleFilterFunction (uk.gov.gchq.gaffer.rest.example.ExampleFilterFunction)1