FetchHints { public static FetchHints union(FetchHints... fetchHints) { return union(Arrays.asList(fetchHints)); } FetchHints(
        boolean includeAllProperties,
        ImmutableSet<String> propertyNamesToInclude,
        boolean includeAllPropertyMetadata,
        ImmutableSet<String> metadataKeysToInclude,
        boolean includeHidden,
        boolean includeAllEdgeRefs,
        boolean includeOutEdgeRefs,
        boolean includeInEdgeRefs,
        boolean includeEdgeIds,
        boolean includeEdgeVertexIds,
        ImmutableSet<String> edgeLabelsOfEdgeRefsToInclude,
        boolean includeEdgeLabelsAndCounts,
        boolean includeExtendedDataTableNames,
        boolean ignoreAdditionalVisibilities,
        boolean includePreviousMetadata
    ); boolean isIncludeAllProperties(); ImmutableSet<String> getPropertyNamesToInclude(); boolean isIncludeAllPropertyMetadata(); ImmutableSet<String> getMetadataKeysToInclude(); boolean isIncludeHidden(); boolean isIncludeAllEdgeRefs(); boolean isIncludeOutEdgeRefs(); boolean isIncludeInEdgeRefs(); boolean isIncludeEdgeIds(); boolean isIncludeEdgeVertexIds(); ImmutableSet<String> getEdgeLabelsOfEdgeRefsToInclude(); boolean isIncludeEdgeLabelsAndCounts(); boolean isIncludeExtendedDataTableNames(); boolean isIgnoreAdditionalVisibilities(); boolean isIncludePreviousMetadata(); boolean isIncludePropertyMetadata(); boolean isIncludeProperties(); boolean isIncludePropertyAndMetadata(String propertyName); boolean isIncludeProperty(String propertyName); boolean isIncludeMetadata(String metadataKey); boolean isIncludeEdgeRefLabel(String label); boolean isIncludeEdgeRefs(); boolean hasEdgeLabelsOfEdgeRefsToInclude(); void validateHasEdgeFetchHints(Direction direction, String... labels); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static FetchHintsBuilder builder(); static FetchHintsBuilder builder(FetchHints fetchHints); void assertPropertyIncluded(String name); void assertMetadataIncluded(String key); boolean hasFetchHints(FetchHints fetchHints); static FetchHints union(FetchHints... fetchHints); static FetchHints union(Iterable<FetchHints> fetchHints); static final FetchHints NONE; static final FetchHints PROPERTIES_AND_METADATA; static final FetchHints ALL; static final FetchHints ALL_INCLUDING_HIDDEN; static final FetchHints EDGE_REFS; static final FetchHints EDGE_LABELS; }
@Test public void testUnion() { assertEquals( FetchHints.builder().build(), FetchHints.union( FetchHints.builder().build(), FetchHints.builder().build() ) ); assertEquals( FetchHints.builder() .setIncludeAllProperties(true) .setIncludeAllPropertyMetadata(true) .setIncludeAllEdgeRefs(true) .setIncludeOutEdgeRefs(true) .setIncludeInEdgeRefs(true) .setIncludeEdgeLabelsAndCounts(true) .setIncludeExtendedDataTableNames(true) .build(), FetchHints.union( FetchHints.builder() .setIncludeAllProperties(true) .setIncludeAllPropertyMetadata(true) .setIncludeAllEdgeRefs(true) .setIncludeOutEdgeRefs(true) .setIncludeInEdgeRefs(true) .setIncludeEdgeLabelsAndCounts(true) .setIncludeExtendedDataTableNames(true) .build(), FetchHints.builder().build() ) ); try { FetchHints.union( FetchHints.builder() .setIncludeHidden(true) .build(), FetchHints.builder() .setIncludeHidden(false) .build() ); fail("should throw"); } catch (VertexiumException ex) { } try { FetchHints.union( FetchHints.builder() .setIgnoreAdditionalVisibilities(true) .build(), FetchHints.builder() .setIgnoreAdditionalVisibilities(false) .build() ); fail("should throw"); } catch (VertexiumException ex) { } try { FetchHints.union( FetchHints.builder() .setIncludePreviousMetadata(true) .build(), FetchHints.builder() .setIncludePreviousMetadata(false) .build() ); fail("should throw"); } catch (VertexiumException ex) { } assertEquals( FetchHints.builder() .setPropertyNamesToInclude("a", "b") .build(), FetchHints.union( FetchHints.builder() .setPropertyNamesToInclude("a") .build(), FetchHints.builder() .setPropertyNamesToInclude("b") .build() ) ); assertEquals( FetchHints.builder() .setIncludeAllProperties(true) .build(), FetchHints.union( FetchHints.builder() .setPropertyNamesToInclude("a") .build(), FetchHints.builder() .setIncludeAllProperties(true) .build() ) ); assertEquals( FetchHints.builder() .setMetadataKeysToInclude("a", "b") .build(), FetchHints.union( FetchHints.builder() .setMetadataKeysToInclude("a") .build(), FetchHints.builder() .setMetadataKeysToInclude("b") .build() ) ); assertEquals( FetchHints.builder() .setIncludeAllPropertyMetadata(true) .build(), FetchHints.union( FetchHints.builder() .setMetadataKeysToInclude("a") .build(), FetchHints.builder() .setIncludeAllPropertyMetadata(true) .build() ) ); assertEquals( FetchHints.builder() .setEdgeLabelsOfEdgeRefsToInclude("a", "b") .build(), FetchHints.union( FetchHints.builder() .setEdgeLabelsOfEdgeRefsToInclude("a") .build(), FetchHints.builder() .setEdgeLabelsOfEdgeRefsToInclude("b") .build() ) ); assertEquals( FetchHints.builder() .setIncludeAllEdgeRefs(true) .build(), FetchHints.union( FetchHints.builder() .setEdgeLabelsOfEdgeRefsToInclude("a") .build(), FetchHints.builder() .setIncludeAllEdgeRefs(true) .build() ) ); }