Package bridge

Class Invocation.Accessor

java.lang.Object
bridge.Invocation.Accessor
Enclosing class:
Invocation

public final class Invocation.Accessor extends Object
A class that is used to build field invocations
Notes:
Invocations must be constructed and completed in a single statement. Partial invocations may not be stored.
  • Method Details

    • get

      public <@Polymorphic T> T get()
      Gets the field value
      Type Parameters:
      T - Requested type
      Returns:
      The current, real value the field holds.
      Throws:
      NoSuchFieldError - When no field with the provided description can be resolved.
      IllegalAccessError - When the resolved field's access modifiers prevent it from being read.
      IncompatibleClassChangeError - When the resolved field is accessed from the wrong context.
      NullPointerException - When the resolved field is an instance field and the instance is null.
      ClassCastException - When the field value is not convertible to the requested type.
    • getAndSet

      public <@Polymorphic T> T getAndSet(Object value)
      Gets, then sets, the field value
      Type Parameters:
      T - Requested type
      Parameters:
      value - The new value the field will hold.
      Returns:
      The previous, real value the field held.
      Throws:
      NoSuchFieldError - When no field with the provided description can be resolved.
      IllegalAccessError - When the resolved field's access modifiers prevent it from being read or written to.
      IncompatibleClassChangeError - When the resolved field is accessed from the wrong context.
      NullPointerException - When the resolved field is an instance field and the instance is null.
      ClassCastException - When the provided value is not convertible to the field type or the field value is not convertible to the requested type.
    • set

      public <T> T set(@Polymorphic T value)
      Sets the field value
      Type Parameters:
      T - Requested type
      Parameters:
      value - The new value the field will hold.
      Returns:
      That same, real value, without any conversions.
      Throws:
      NoSuchFieldError - When no field with the provided description can be resolved.
      IllegalAccessError - When the resolved field's access modifiers prevent it from being written to.
      IncompatibleClassChangeError - When the resolved field is accessed from the wrong context.
      NullPointerException - When the resolved field is an instance field and the instance is null.
      ClassCastException - When the provided value is not convertible to the field type.
    • setAndGet

      public <@Polymorphic T> T setAndGet(Object value)
      Sets, then gets, the field value
      Type Parameters:
      T - Requested type
      Parameters:
      value - The new value the field will hold.
      Returns:
      That same, real value, with all required conversions applied.
      Throws:
      NoSuchFieldError - When no field with the provided description can be resolved.
      IllegalAccessError - When the resolved field's access modifiers prevent it from being written to.
      IncompatibleClassChangeError - When the resolved field is accessed from the wrong context.
      NullPointerException - When the resolved field is an instance field and the instance is null.
      ClassCastException - When the provided value is not convertible to the field type or the field value is not convertible to the requested type.