本文整理了Java中org.apache.tinkerpop.gremlin.structure.Direction.valueOf()
方法的一些代码示例,展示了Direction.valueOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Direction.valueOf()
方法的具体详情如下:
包路径:org.apache.tinkerpop.gremlin.structure.Direction
类名称:Direction
方法名:valueOf
暂无
代码示例来源:origin: hugegraph/hugegraph
public static Direction parseDirection(String direction) {
if (direction == null || direction.isEmpty()) {
return Direction.BOTH;
}
try {
return Direction.valueOf(direction);
} catch (Exception e) {
throw new IllegalArgumentException(String.format(
"Direction value must be in [OUT, IN, BOTH], " +
"but got '%s'", direction));
}
}
代码示例来源:origin: apache/tinkerpop
@Override
public void loadState(final Graph graph, final Configuration configuration) {
direction = Direction.valueOf(configuration.getString(DIRECTION_CFG_KEY));
switch (direction) {
case IN:
this.messageScope = this.inMessageScope;
break;
case OUT:
this.messageScope = this.outMessageScope;
break;
case BOTH:
this.messageScope = this.bothMessageScope;
break;
default:
throw new IllegalStateException("Should not reach this point!");
}
}
代码示例来源:origin: org.apache.tinkerpop/gremlin-test
@Override
public void loadState(final Graph graph, final Configuration configuration) {
direction = Direction.valueOf(configuration.getString(DIRECTION_CFG_KEY));
switch (direction) {
case IN:
this.messageScope = this.inMessageScope;
break;
case OUT:
this.messageScope = this.outMessageScope;
break;
case BOTH:
this.messageScope = this.bothMessageScope;
break;
default:
throw new IllegalStateException("Should not reach this point!");
}
}
代码示例来源:origin: unipop-graph/unipop
private EdgeSchema getEdgeSchema(JSONObject edgeJson) throws JSONException {
Direction direction = Direction.valueOf(edgeJson.optString("direction"));
return new InnerRowEdgeSchema(this, direction, edgeJson, table, graph);
}
}
代码示例来源:origin: unipop-graph/unipop
private EdgeSchema getEdgeSchema(JSONObject edgeJson) throws JSONException {
Direction direction = Direction.valueOf(edgeJson.optString("direction"));
return new InnerEdgeRestSchema(edgeJson, this.graph, this.baseUrl, this.templateHolder, this.resultPath, this.opTranslator, this.maxResultSize, this.complexTranslator, this.valuesToString, direction, this, this.resource);
}
代码示例来源:origin: unipop-graph/unipop
private EdgeSchema getEdgeSchema(JSONObject edgeJson) throws JSONException {
String path = edgeJson.optString("path", null);
Direction direction = Direction.valueOf(edgeJson.optString("direction"));
if(path == null) return new InnerEdgeSchema(this, direction, index, type, edgeJson, client, graph);
return new NestedEdgeSchema(this, direction, index, type, path, edgeJson, client, graph);
}
代码示例来源:origin: org.jboss.windup.web.addons/windup-web-support-impl
@Override
public List<Map<String, Object>> getEdges(Long executionID, Integer vertexID, String edgeDirection, String edgeLabel, Boolean dedup)
{
GraphContext graphContext = getGraph(executionID);
if (vertexID == null)
throw new IllegalArgumentException("ID not specified");
Vertex vertex = graphContext.getGraph().vertices(vertexID).next();
List<Map<String, Object>> vertices = new ArrayList<>();
Iterator<Vertex> relatedVertices = vertex.vertices(Direction.valueOf(edgeDirection), edgeLabel);
while (relatedVertices.hasNext())
{
Vertex v = relatedVertices.next();
vertices.add(convertToMap(executionID, v, 0, dedup));
}
return vertices;
}
内容来源于网络,如有侵权,请联系作者删除!