InstanceHandler function#

package: org.yuanrong.call.

public class InstanceHandler#

Create an operation class for creating a Java stateful function instance.

Note

The class InstanceHandler is the handle returned after creating a Java class instance; it is the return type of the interface InstanceCreator.invoke after creating a Java class instance.

Users can use the function method of the built-inInstanceHandler to create a Java class instance member method handle and return the handle class InstanceFunctionHandler.

Interface description#

public VoidInstanceFunctionHandler function(YRFuncVoid0 func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 0 input parameters and 0 return values.

public <T0> VoidInstanceFunctionHandler function(YRFuncVoid1<T0> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 1 input parameter and 0 return values.

public <T0, T1> VoidInstanceFunctionHandler function(YRFuncVoid2<T0, T1> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 2 input parameters and 0 return values.

  • Parameters:

    • <T0> - Input parameter type.

    • <T1> - Input parameter type.

    • func - YRFuncVoid2 Class instance.

  • Returns:

    VoidInstanceFunctionHandler Instance.

public <T0, T1, T2> VoidInstanceFunctionHandler function(YRFuncVoid3<T0, T1, T2> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 3 parameters and 0 return values.

  • Parameters:

    • <T0> - Input parameter type.

    • <T1> - Input parameter type.

    • <T2> - Input parameter type.

    • func - YRFuncVoid3 Class instance.

  • Returns:

    VoidInstanceFunctionHandler Instance.

public <T0, T1, T2, T4> VoidInstanceFunctionHandler function(YRFuncVoid4<T0, T1, T2, T4> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 4 parameters and 0 return values.

  • Parameters:

    • <T0> - Input parameter type.

    • <T1> - Input parameter type.

    • <T2> - Input parameter type.

    • <T4> - Input parameter type.

    • func - YRFuncVoid4 Class instance.

  • Returns:

    VoidInstanceFunctionHandler Instance.

public <T0, T1, T2, T4, T5> VoidInstanceFunctionHandler function(YRFuncVoid5<T0, T1, T2, T4, T5> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 5 parameters and 0 return values.

  • Parameters:

    • <T0> - Input parameter type.

    • <T1> - Input parameter type.

    • <T2> - Input parameter type.

    • <T4> - Input parameter type.

    • <T5> - Input parameter type.

    • func - YRFuncVoid5 Class instance.

  • Returns:

    VoidInstanceFunctionHandler Instance.

public <R> InstanceFunctionHandler<R> function(YRFunc0<R> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 0 input parameters and 1 return value.

public <T0, R> InstanceFunctionHandler<R> function(YRFunc1<T0, R> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 1 input parameter and 1 return value.

InstanceHandler InstanceHandler = YR.instance(Counter::new).invoke(1);
ObjectRef ref = InstanceHandler.function(Counter::Add).invoke(5);
int res = (int)YR.get(ref, 100);
InstanceHandler.terminate();
  • Parameters:

    • <T0> - Input parameter type.

    • <R> - Return value type.

    • func - YRFunc1 Class instance.

  • Returns:

    InstanceFunctionHandler Instance.

public <T0, T1, R> InstanceFunctionHandler<R> function(YRFunc2<T0, T1, R> func)#

Java functions in the cloud can call member functions of Java class instances in the cloud, supporting user functions with 2 input parameters and 1 return value.

  • Parameters:

    • <T0> - Input parameter type.

    • <T1> - Input parameter type.

    • <R> - Return value type.

    • func - YRFunc2 Class instance.

  • Returns:

    InstanceFunctionHandler Instance.

public <T0, T1, T2, R> InstanceFunctionHandler<R> function(YRFunc3<T0, T1, T2, R> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 3 parameters and 1 return value.

  • Parameters:

    • <T0> - Input parameter type.

    • <T1> - Input parameter type.

    • <T2> - Input parameter type.

    • <R> - Return value type.

    • func - YRFunc3 Class instance.

  • Returns:

    InstanceFunctionHandler Instance.

public <T0, T1, T2, T3, R> InstanceFunctionHandler<R> function(YRFunc4<T0, T1, T2, T3, R> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 4 parameters and 1 return value.

  • Parameters:

    • <T0> - Input parameter type.

    • <T1> - Input parameter type.

    • <T2> - Input parameter type.

    • <T3> - Input parameter type.

    • <R> - Return value type.

    • func - YRFunc4 Class instance.

  • Returns:

    InstanceFunctionHandler Instance.

public <T0, T1, T2, T3, T4, R> InstanceFunctionHandler<R> function(YRFunc5<T0, T1, T2, T3, T4, R> func)#

Java functions under the cloud call member functions of Java class instances on the cloud, supporting user functions with 5 parameters and 1 return value.

  • Parameters:

    • <T0> - Input parameter type.

    • <T1> - Input parameter type.

    • <T2> - Input parameter type.

    • <T3> - Input parameter type.

    • <T4> – Input parameter type.

    • <R> - Return value type.

    • func - YRFunc5 Class instance.

  • Returns:

    InstanceFunctionHandler Instance.