Class Access.Method

java.lang.Object
net.ME1312.Galaxi.Library.Access.Method
Enclosing class:
Access

public static final class Access.Method extends Object
Method Accessor Class
  • Method Details

    • clone

      public Access.Method clone()
      Create an editable clone of this accessor
      Returns:
      Cloned Method Accessor
    • name

      public String name()
      Get the name of this method
      Returns:
      Method Name
    • returns

      public Access.Method returns(Class<?> type)
      Define the return type of this method
      If this method is not called, the return type is assumed to be void
      Parameters:
      type - Return Type
    • returns

      public Class<?> returns()
      Get the return type of this method
      Returns:
      Return Type
    • parameters

      public Access.Method parameters(Class<?>... types)
      Define the parameters of this method
      If this method is not called, it is assumed that there are no parameters
      Parameters:
      types - Parameter Types
    • parameters

      public Class<?>[] parameters()
      Get the parameter types of this method
      Returns:
      Parameter Types
    • instance

      public Access.Method instance(Object instance)
      Switch to instance method selection mode
      If this method is not called, we remain in static method selection mode
      Parameters:
      instance - Instance
    • instance

      public Object instance()
      Get the instance this method will run under
      Returns:
      Instance
    • bind

      public Access.Method bind() throws Throwable
      Finalize and cache the method
      Throws:
      Throwable
    • handle

      public MethodHandle handle() throws Throwable
      Finalize, cache, and select the method
      Returns:
      MethodHandle
      Throws:
      Throwable
    • invoke

      public <R> R invoke() throws Throwable
      Finalize, cache, select, and invoke the method (with zero arguments)
      Returns:
      Method Return Value
      Throws:
      Throwable
    • invoke

      public <R> R invoke(Try.Function<MethodHandle,Object> invocation) throws Throwable
      Finalize, cache, select, and invoke the method
      Parameters:
      invocation - Invocation Instruction
      Returns:
      Method Return Value
      Throws:
      Throwable