There are sevarel solutions for this issue.
Use reflection to find the function (by its name or annotation).
you can also use common interface with generics.