Class Access.Field

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

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

    • name

      public String name()
      Get the name of this field
      Returns:
      Field Name
    • type

      public Class<?> type()
      Get the data type of this field
      Returns:
      Field Data Type
    • instance

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

      public Object instance()
      Get the instance this field belongs to
      Returns:
      Instance
    • bind

      public Access.Field bind() throws Throwable
      Finalize and cache the field getter
      Throws:
      Throwable
      See Also:
      • Use setter() to do the same to the field setter
    • setter

      public MethodHandle setter() throws Throwable
      Finalize, cache, and select the field setter
      Returns:
      MethodHandle
      Throws:
      Throwable
    • getter

      public MethodHandle getter() throws Throwable
      Finalize, cache, and select the field getter
      Returns:
      MethodHandle
      Throws:
      Throwable
    • get

      public <R> R get() throws Throwable
      Finalize, cache, select, and invoke the field getter
      Returns:
      Field Value
      Throws:
      Throwable
    • get

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