use of org.apache.tinkerpop.gremlin.structure.util.ElementHelper in project unipop by unipop-graph.
the class UniGraph method addVertex.
@Override
public Vertex addVertex(final Object... keyValues) {
ElementHelper.legalPropertyKeyValueArray(keyValues);
Optional<String> labelValue = ElementHelper.getLabelValue(keyValues);
labelValue.ifPresent(ElementHelper::validateLabel);
return controllerManager.getControllers(AddVertexQuery.AddVertexController.class).stream().map(controller -> controller.addVertex(new AddVertexQuery(ConversionUtils.asMap(keyValues), null))).filter(Objects::nonNull).findFirst().get();
}
Aggregations