pyjnius
pyjnius copied to clipboard
NotImplementedError: The method ('apply', ('Ljava/lang/Object;', ('Ljava/lang/Object;',))) is not implemented
Facing this error
===== Python/java method missing ====== Python class:<hederaDid.generated.PyFunction object at 0x7fb5258aab40> Java method name:apply Signature: (Ljava/lang/Object;)Ljava/lang/Object;
Traceback (most recent call last): File "jnius/jnius_proxy.pxi", line 50, in jnius.PythonJavaClass.invoke File "jnius/jnius_proxy.pxi", line 74, in jnius.PythonJavaClass._invoke NotImplementedError: The method ('apply', ('Ljava/lang/Object;', ('Ljava/lang/Object;',))) is not implemented
PyFunction class is defined as :
class PyFunction(PythonJavaClass):
__javainterfaces__ = ['java/util/function/Function']
def __init__(self, fn):
self.fn = fn
@java_method('(Ljava/lang/Object;)Ljava/lang/Object;')
def apply(self, tx):
return self.fn(tx)
Can you please advise what's missing here ?