I am using COALESCE to return the alternate value if a traversal does not exists. below is the query
g.V('machine1').project('machine', 'make').by(identity()).by(coalesce(out('ofMake'), constant('null'))
this works just fine but when i use this query in java gremlin driver, i get back following JAVA TYPES in the RESULT object,
Machine as DetachedVertex type
Make as java.lang.String with value NULL, and if it exists then DetachedVertex type.
This makes me do few if's and else in my code, Is it possible to make query return NULL as an OBJECT instead of String , so that i can simple check NOT NULL condition ?