in src/main/java/com/microsoft/spring/data/gremlin/conversion/result/GremlinResultsGraphReader.java [48:72]
private GremlinSource processResult(Result result) {
final GremlinSource source;
final Object obj = result.getObject();
Assert.isInstanceOf(Map.class, obj, "should be an instance of Map");
@SuppressWarnings("unchecked") final Map<String, Object> map = (Map<String, Object>) result.getObject();
Assert.isTrue(map.containsKey(PROPERTY_TYPE), "should contain a type property");
final String type = (String) map.get(PROPERTY_TYPE);
switch (type) {
case RESULT_TYPE_VERTEX:
source = new GremlinSourceVertex();
vertexResultReader.read(singletonList(result), source);
break;
case RESULT_TYPE_EDGE:
source = new GremlinSourceEdge();
edgeResultReader.read(singletonList(result), source);
break;
default:
throw new GremlinUnexpectedEntityTypeException("Unexpected result type: " + type);
}
return source;
}