I'd like to be able to access closure environment information at runtime from a Java functional interface. For example, I'm passing in a lambda, say, (input) -> input + knownVariable
to a function lambdaProcessor
.
Now, from within lambdaProcessor
, I'd like to be able to access the environment associated with this lamdba, and get the value of all the variables stored in this environment.
Is this possible? I don't mind having to create my own functional interface, or use reflection, etc.
Aucun commentaire:
Enregistrer un commentaire