Casting issue with Gremlin Java
I wrote the following query and I can't get it to compile, tried a ton of casting but it just isn't happy...
The problem is because of the fold it loses the type and then the type going into the repeat will not allow me to execute an in() step. I tried casting the unfold() and the in() to GraphTraversal<Vertex, Vertex> and variations of that with 1 vertex switched for Object. I cannot get this to compile. Anyone have any ideas on how to cast this properly?
5 Replies
If I switch the by(__unfold() for by( V() it works but obviously that isn't what I want and i cant cast it to the type of V()...
I may be missing something but if you
unfold()
immediately after fold()
, can you just omit it ?
or does this work ?
problem is when you go into the project without the fold it just gives 1 item in and so you have to fold before hand
Ah I see. Does specifying a type in generics above work ?
it did not, sorry I was moving and was away for a while
I havent found a way to do it so I just rewrote the query to not require it