Class InvocationArg

    • Field Detail

      • CONTENTS_ARRAY

        public static final String CONTENTS_ARRAY
        The array contents should map to a List. This is in order to allow calls of type Arrays.asList(arg1, arg2, arg3, ...)
        See Also:
        Constant Field Values
    • Method Detail

      • isSerialized

        public boolean isSerialized()
        If true, the argument is taken straight by the Java code as Object. If false, the argument is a json document that need to be deserialized to an Object.
        Returns:
        The The argFrom
      • getObjectClassName

        public String getObjectClassName()
        The type of this argument. This is used when json objects come from Rust, in order to be mapped to proper Java Objects.
        Specified by:
        getObjectClassName in interface ObjectValue
        Returns:
        The classname
      • getInstance

        public Instance getInstance()
      • invoke

        public Instance invoke​(String methodName,
                               InvocationArg... args)
        Description copied from interface: Instance
        Invokes a method of the instance of the class that is set for this Instance
        Specified by:
        invoke in interface Instance
        Parameters:
        methodName - The method name
        args - The arguments to use for invoking the method
        Returns:
        A Instance instance containing the result of the invocation
      • invokeStatic

        public Instance invokeStatic​(String methodName,
                                     InvocationArg... args)
        Description copied from interface: Instance
        Invokes a static method of the class that is set for this Instance
        Specified by:
        invokeStatic in interface Instance
        Parameters:
        methodName - The static method name
        args - The arguments to use for invoking the static method
        Returns:
        A Instance instance containing the result of the invocation
      • invokeAsync

        public void invokeAsync​(long functionPointerAddress,
                                String methodName,
                                InvocationArg... args)
        Description copied from interface: Instance
        Invokes asynchronously a method of the instance of the class that is set for this Instance. The result of the invocation should be provided later using the performCallback method of a NativeCallbackSupport class. Any possible returned objects from the actual synchronous invocation of the defined method will be dropped.
        Specified by:
        invokeAsync in interface Instance
        Parameters:
        functionPointerAddress - The address of the function pointer that will be used later in the native side in order to actually paerform the callback.
        methodName - The method name
        args - The arguments to use when invoking the callback method (the functionPointer)
      • invokeToChannel

        public void invokeToChannel​(long channelAddress,
                                    String methodName,
                                    InvocationArg... args)
        Description copied from interface: Instance
        Invokes a method of the instance of the class that is set for this Instance. The result of the invocation should be provided later using the doCallback method of a NativeCallbackToRustChannelSupport class. Any possible returned objects from the actual synchronous invocation of the defined method will be dropped.
        Specified by:
        invokeToChannel in interface Instance
        Parameters:
        channelAddress - The memory address of the channel
        methodName - The method name
        args - The arguments
      • initializeCallbackChannel

        public void initializeCallbackChannel​(long channelAddress)
        Description copied from interface: Instance
        Initialize a callback channel for this Instance. The channel can be used by Java to send values to Rust using the doCallback method of a NativeCallbackToRustChannelSupport class.
        Specified by:
        initializeCallbackChannel in interface Instance
        Parameters:
        channelAddress - The memory address of the channel
      • field

        public Instance field​(String fieldName)
        Description copied from interface: Instance
        Retrieves the instance held under the Field fieldName
        Specified by:
        field in interface Instance
        Parameters:
        fieldName - The name of the field to retrieve
        Returns:
        A Instance instance containing the defined field.