Record Class Invoker

java.lang.Object
java.lang.Record
pro.verron.officestamper.core.Invoker
Record Components:
name - the name of the method to be invoked.
args - the arguments for the method invocation.
executor - the executor responsible for executing the method.

public record Invoker(String name, Invokers.Args args, org.springframework.expression.MethodExecutor executor) extends Record
Represents an invoker that encapsulates the name, arguments, and executor of a method to be invoked. It acts as a wrapper to facilitate method invocation with specific parameters, and a dedicated execution strategy.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Invoker(Object obj, Method method)
    Constructs an Invoker instance by extracting the method name, parameter types, and creating a corresponding ReflectionExecutor for the provided object and method.
    Invoker(String name, List<Class<?>> args, org.springframework.expression.MethodExecutor executor)
    Constructs an Invoker instance using the provided method name, argument types, and executor.
    Invoker(String name, Invokers.Args args, org.springframework.expression.MethodExecutor executor)
    Creates an instance of a Invoker record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the args record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    org.springframework.expression.MethodExecutor
    Returns the value of the executor record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the name record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Invoker

      public Invoker(Object obj, Method method)
      Constructs an Invoker instance by extracting the method name, parameter types, and creating a corresponding ReflectionExecutor for the provided object and method.
      Parameters:
      obj - the object on which the method will be invoked.
      method - the method to be invoked, including its name and parameter types.
    • Invoker

      public Invoker(String name, List<Class<?>> args, org.springframework.expression.MethodExecutor executor)
      Constructs an Invoker instance using the provided method name, argument types, and executor.
      Parameters:
      name - the name of the method to be invoked.
      args - the list of argument types required for the method invocation.
      executor - the executor responsible for executing the method.
    • Invoker

      public Invoker(String name, Invokers.Args args, org.springframework.expression.MethodExecutor executor)
      Creates an instance of a Invoker record class.
      Parameters:
      name - the value for the name record component
      args - the value for the args record component
      executor - the value for the executor record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • args

      public Invokers.Args args()
      Returns the value of the args record component.
      Returns:
      the value of the args record component
    • executor

      public org.springframework.expression.MethodExecutor executor()
      Returns the value of the executor record component.
      Returns:
      the value of the executor record component