@Test public void testEdge() { GradoopId edgeId = GradoopId.get(); GradoopId sourceId = GradoopId.get(); GradoopId targetId = GradoopId.get(); String label = "A"; Properties props = Properties.create(); props.set("k1", "v1"); props.set("k2", "v2"); Edge edge = new EPGMEdgeFactory().initEdge(edgeId, label, sourceId, targetId, props); String newLabel = "B"; TransformationFunction<Edge> renameFunction = new RenameLabel<>(label, newLabel); renameFunction.apply(edge, edge); assertEquals(newLabel, edge.getLabel()); assertThat(edge.getPropertyValue("k1").toString(), Is.<Object>is("v1")); assertThat(edge.getPropertyValue("k2").toString(), Is.<Object>is("v2")); }
@Override public T apply(T current, T transformed) { if (current.getLabel().equals(oldLabel)) { current.setLabel(newLabel); } return current; }
RenameLabel implements TransformationFunction<T> { @Override public T apply(T current, T transformed) { if (current.getLabel().equals(oldLabel)) { current.setLabel(newLabel); } return current; } }
RenameLabel implements TransformationFunction<T> { @Override public T apply(T current, T transformed) { if (current.getLabel().equals(oldLabel)) { current.setLabel(newLabel); } return current; } RenameLabel(String oldLabel, String newLabel); }
RenameLabel implements TransformationFunction<T> { @Override public T apply(T current, T transformed) { if (current.getLabel().equals(oldLabel)) { current.setLabel(newLabel); } return current; } RenameLabel(String oldLabel, String newLabel); @Override T apply(T current, T transformed); }
RenameLabel implements TransformationFunction<T> { @Override public T apply(T current, T transformed) { if (current.getLabel().equals(oldLabel)) { current.setLabel(newLabel); } return current; } RenameLabel(String oldLabel, String newLabel); @Override T apply(T current, T transformed);  }