use of com.tinkerpop.pipes.PipeFunction in project gremlin by tinkerpop.
the class BackStepTest method test_g_v4_out_asXhereX_filterXlang_eq_javaX_backXhereX_propertyXnameX.
public void test_g_v4_out_asXhereX_filterXlang_eq_javaX_backXhereX_propertyXnameX() {
super.test_g_v4_out_asXhereX_filterXlang_eq_javaX_backXhereX_propertyXnameX(new GremlinPipeline(g.getVertex(4)).out().as("here").filter(new PipeFunction<Vertex, Boolean>() {
public Boolean compute(Vertex v) {
return v.getProperty("lang").equals("java");
}
}).back("here").property("name"));
super.test_g_v4_out_asXhereX_filterXlang_eq_javaX_backXhereX_propertyXnameX(new GremlinPipeline(g.getVertex(4)).optimize(false).out().as("here").filter(new PipeFunction<Vertex, Boolean>() {
public Boolean compute(Vertex v) {
return v.getProperty("lang").equals("java");
}
}).back("here").property("name"));
}
use of com.tinkerpop.pipes.PipeFunction in project gremlin by tinkerpop.
the class FilterStepTest method test_g_v1_out_filterXage_gt_30X.
public void test_g_v1_out_filterXage_gt_30X() {
super.test_g_v1_out_filterXage_gt_30X(new GremlinPipeline(g.getVertex(1)).out().filter(new PipeFunction<Vertex, Boolean>() {
public Boolean compute(Vertex vertex) {
Integer age = (Integer) vertex.getProperty("age");
return age != null && age > 30;
}
}));
super.test_g_v1_out_filterXage_gt_30X(new GremlinPipeline(g.getVertex(1)).optimize(false).out().filter(new PipeFunction<Vertex, Boolean>() {
public Boolean compute(Vertex vertex) {
Integer age = (Integer) vertex.getProperty("age");
return age != null && age > 30;
}
}));
}
use of com.tinkerpop.pipes.PipeFunction in project gremlin by tinkerpop.
the class GroupByStepTest method test_g_V_groupByXlang_nameX.
public void test_g_V_groupByXlang_nameX() {
Map<?, List<?>> m = new HashMap<Object, List<?>>();
super.test_g_V_groupByXlang_nameX(new GremlinPipeline(g.getVertices()).groupBy(m, new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("lang");
}
}, new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("name");
}
}), (Map) m);
m = new HashMap<Object, List<?>>();
super.test_g_V_groupByXlang_nameX(new GremlinPipeline(g.getVertices()).optimize(false).groupBy(m, new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("lang");
}
}, new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("name");
}
}), (Map) m);
}
use of com.tinkerpop.pipes.PipeFunction in project gremlin by tinkerpop.
the class SelectStepTest method test_g_v1_asXaX_outXknowsX_asXbX_selectXnameX.
public void test_g_v1_asXaX_outXknowsX_asXbX_selectXnameX() {
super.test_g_v1_asXaX_outXknowsX_asXbX_selectXnameX(new GremlinPipeline(g.getVertex(1)).as("a").out("knows").as("b").select(new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("name");
}
}));
super.test_g_v1_asXaX_outXknowsX_asXbX_selectXnameX(new GremlinPipeline(g.getVertex(1)).optimize(false).as("a").out("knows").as("b").select(new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("name");
}
}));
}
use of com.tinkerpop.pipes.PipeFunction in project gremlin by tinkerpop.
the class PathStepTest method test_g_v1_out_pathXage__nameX.
public void test_g_v1_out_pathXage__nameX() {
super.test_g_v1_out_pathXage__nameX(new GremlinPipeline(g.getVertex(1)).out().path(new PipeFunction<Vertex, Integer>() {
public Integer compute(Vertex vertex) {
return (Integer) vertex.getProperty("age");
}
}, new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("name");
}
}));
super.test_g_v1_out_pathXage__nameX(new GremlinPipeline(g.getVertex(1)).optimize(false).out().path(new PipeFunction<Vertex, Integer>() {
public Integer compute(Vertex vertex) {
return (Integer) vertex.getProperty("age");
}
}, new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("name");
}
}));
}
Aggregations