use of org.unipop.query.mutation.AddEdgeQuery in project unipop by unipop-graph.
the class UniVertex method addEdge.
@Override
public Edge addEdge(final String label, final Vertex vertex, final Object... keyValues) {
if (null == vertex)
throw Graph.Exceptions.argumentCanNotBeNull("vertex");
ElementHelper.legalPropertyKeyValueArray(keyValues);
ElementHelper.validateLabel(label);
Map<String, Object> stringObjectMap = ConversionUtils.asMap(keyValues);
stringObjectMap.put(T.label.toString(), label);
return graph.getControllerManager().getControllers(AddEdgeQuery.AddEdgeController.class).stream().map(controller -> controller.addEdge(new AddEdgeQuery(this, vertex, new HashMap<>(stringObjectMap), null))).filter(e -> e != null).findFirst().get();
}
Aggregations