LanguageElement currentValue = library.getElements().get(operation.vertex.index);
if (currentValue.getClass() != operation.newValue.getClass()) {
throw new IllegalArgumentException(String.format("Cannot edit node %s with %s because the current type is %s",
operation.vertex, operation.newValue, currentValue.getClass()));
}
library.replace(operation.vertex.index, operation.newValue);
}
public void addEdge(NewEdgeOperation operation) {
if (operation.src.vertex == Vertex.NONE) {
throw new IllegalArgumentException("src element has no vertex");