final JSONObject edge = edges.optJSONObject(i);
FaunusEdge faunusEdge = null;
if (direction.equals(Direction.IN)) {
faunusEdge = (FaunusEdge) graphson.edgeFromJson(edge, new FaunusVertex(edge.optLong(GraphSONTokens._OUT_V)), vertex);
} else if (direction.equals(Direction.OUT)) {
faunusEdge = (FaunusEdge) graphson.edgeFromJson(edge, vertex, new FaunusVertex(edge.optLong(GraphSONTokens._IN_V)));
}
if (faunusEdge != null) {
vertex.addEdge(direction, faunusEdge);
}