vertexId = null;
}
Preconditions.checkArgument(vertexId != null || !graph.getConfiguration().allowVertexIdSetting(), "Must provide vertex id");
Preconditions.checkArgument(vertexId == null || IDManager.isVertexID(vertexId), "Not a valid vertex id: %s", vertexId);
Preconditions.checkArgument(vertexId == null || !config.hasVerifyExternalVertexExistence() || !containsVertex(vertexId), "Vertex with given id already exists: %s", vertexId);
StandardVertex vertex = new StandardVertex(this, temporaryID.decrementAndGet(), ElementLifeCycle.New);
if (vertexId != null) {
vertex.setID(vertexId);
} else if (config.hasAssignIDsImmediately()) {
graph.assignID(vertex);
}
addProperty(vertex, SystemKey.VertexState, SystemKey.VertexStates.DEFAULT.getValue());
vertexCache.add(vertex, vertex.getID());
return vertex;
}