@Test public void getValuesAddsTheRelationNamesBelongingToTheVertext() { List<Vertex> vertices = newGraph() .withVertex("v1", v -> v.withTimId("1")) .withVertex("v2", v -> v.withTimId("2").withOutgoingRelation(RELATION_NAME, "v1")) .build().traversal().V().toList(); Collections.sort(vertices, (vertexA, vertexB) -> ((String) vertexA.property("tim_id").value()).compareTo((String) vertexB.property("tim_id").value())); List<String> values = instance.getValues(vertices.get(0)); List<String> values2 = instance.getValues(vertices.get(1)); assertThat(values, contains(RELATION_NAME)); assertThat(values2, equalTo(Lists.newArrayList())); }
public List<String> getValues(Vertex vertex) { return this.relationNames.stream().filter(relationName -> vertex.edges(Direction.IN, relationName).hasNext() ).collect(toList()); }
EdgeListFacetDescription extends AbstractFacetDescription { public List<String> getValues(Vertex vertex) { return this.relationNames.stream().filter(relationName -> vertex.edges(Direction.IN, relationName).hasNext() ).collect(toList()); } }
EdgeListFacetDescription extends AbstractFacetDescription { public List<String> getValues(Vertex vertex) { return this.relationNames.stream().filter(relationName -> vertex.edges(Direction.IN, relationName).hasNext() ).collect(toList()); } EdgeListFacetDescription(String facetName, String... relationNames); }
EdgeListFacetDescription extends AbstractFacetDescription { public List<String> getValues(Vertex vertex) { return this.relationNames.stream().filter(relationName -> vertex.edges(Direction.IN, relationName).hasNext() ).collect(toList()); } EdgeListFacetDescription(String facetName, String... relationNames); @Override void filter(GraphTraversal<Vertex, Vertex> graphTraversal, List<FacetValue> facets); List<String> getValues(Vertex vertex); }
EdgeListFacetDescription extends AbstractFacetDescription { public List<String> getValues(Vertex vertex) { return this.relationNames.stream().filter(relationName -> vertex.edges(Direction.IN, relationName).hasNext() ).collect(toList()); } EdgeListFacetDescription(String facetName, String... relationNames); @Override void filter(GraphTraversal<Vertex, Vertex> graphTraversal, List<FacetValue> facets); List<String> getValues(Vertex vertex);  }