Just a documentation change - each of these closures had a different signature and I was getting confused.
The Groovy @ClosureParams annotation is more suited for adding type hints to method parameters than to fields, it did not seem to work here.
I settled for a custom but hopefully self-evident syntax of { Type1, Type2, ... -> ReturnType1 | ReturnType2 | .... } in the field comment to explain/remind the user what closure to use in that spot.
Just a documentation change - each of these closures had a different signature and I was getting confused.
The Groovy
@ClosureParams
annotation is more suited for adding type hints to method parameters than to fields, it did not seem to work here.I settled for a custom but hopefully self-evident syntax of
{ Type1, Type2, ... -> ReturnType1 | ReturnType2 | .... }
in the field comment to explain/remind the user what closure to use in that spot.