So I am having trouble how I would convert a nodeTraversal into Hashset.
GraphTraversal<vertex, vertex>nodeTraversal = this.central.V().has(nodeid).in("node").values(nodeId);
So far I have: GraphTraverl<vertex, vertex>nodeTraversal that returns the values of ids. I want to then convert that to a set by doing .toSet(), but get a cannot convert set<Object> to set<String>. I try to add a .join(',') like the tinkerpop docs but not luck.
Anyone know why?
I assume this is just an issue with getting the generics right. You've created
nodeTraversalwith<Vertex, Vertex>but that's technically not what you're returning. the outgoing object fromnodeTraversal(i.e. the secondVertexgeneric definition) is not aVertexbut the data type of whatever the property given tovalues()is. Let's assume it was aString. Your code would look like: