View extends ElementDefinitions<ViewElementDefinition, ViewElementDefinition> implements Cloneable { public boolean hasPostAggregationFilters() { return hasFilters(ViewElementDefinition::hasPostAggregationFilters); } View(); static View fromJson(final InputStream inputStream); static View fromJson(final Path filePath); static View fromJson(final byte[] jsonBytes); byte[] toCompactJson(); @Override String toString(); @Override ViewElementDefinition getElement(final String group); Set<String> getElementGroupBy(final String group); boolean isAllEntities(); void setAllEntities(final boolean allEntities); boolean isAllEdges(); void setAllEdges(final boolean allEdges); List<GlobalViewElementDefinition> getGlobalElements(); List<GlobalViewElementDefinition> getGlobalEntities(); List<GlobalViewElementDefinition> getGlobalEdges(); boolean hasPreAggregationFilters(); boolean hasPostAggregationFilters(); boolean hasPostTransformFilters(); boolean hasEntityFilters(); boolean hasEdgeFilters(); @SuppressWarnings("CloneDoesntCallSuperClone") @SuppressFBWarnings(value = "CN_IDIOM_NO_SUPER_CALL", justification = "Only inherits from Object") @Override View clone(); void expandGlobalDefinitions(); @JsonInclude(Include.NON_EMPTY) Map<String, String> getConfig(); void addConfig(final String key, final String value); String getConfig(final String key); boolean canMerge(final View addingView, final View srcView); @Override boolean equals(final Object obj); @Override int hashCode(); @JsonInclude(Include.NON_NULL) @JsonGetter("class") String getClassName();  }
@Test public void shouldReturnTrueWhenViewHasPostAggEntityFilters() { final View view = new View.Builder() .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .postAggregationFilter(new ElementFilter.Builder() .select(TestPropertyNames.PROP_1) .execute(new Exists()) .build()) .build()) .edge(TestGroups.EDGE) .edge(TestGroups.EDGE_2, null) .build(); final boolean result = view.hasPostAggregationFilters(); assertTrue(result); }
@Test public void shouldReturnTrueWhenViewHasPostAggEdgeFilters() { final View view = new View.Builder() .entity(TestGroups.ENTITY) .edge(TestGroups.EDGE, new ViewElementDefinition.Builder() .postAggregationFilter(new ElementFilter.Builder() .select(TestPropertyNames.PROP_1) .execute(new Exists()) .build()) .build()) .edge(TestGroups.EDGE_2, null) .build(); final boolean result = view.hasPostAggregationFilters(); assertTrue(result); }
@Test public void shouldReturnFalseWhenViewHasNullPostAggEdgeFilters() { final View view = new View.Builder() .edge(TestGroups.EDGE, new ViewElementDefinition.Builder() .postAggregationFilter(null) .build()) .build(); final boolean result = view.hasPostAggregationFilters(); assertFalse(result); }
@Test public void shouldReturnFalseWhenViewHasEmptyPostAggEdgeFilters() { final View view = new View.Builder() .edge(TestGroups.EDGE, new ViewElementDefinition.Builder() .postAggregationFilter(new ElementFilter.Builder() .build()) .build()) .build(); final boolean result = view.hasPostAggregationFilters(); assertFalse(result); }