public static Proto.Node toProto(Node node) { return Proto.Node.newBuilder() .setId(Id.toProtoSpace(node.id)) .setX(node.position.x) .setY(node.position.y) .setColour(node.colour.colour) .build(); }
public static Node fromProto(Proto.Node nodeProto) { return new Node( Id.fromProtoSpace(nodeProto.getId()), new Point(nodeProto.getX(), nodeProto.getY()), new NodeColour(nodeProto.getColour())); }