Class DynFields.UnboundField<T>

  • Enclosing class:
    DynFields

    public static class DynFields.UnboundField<T>
    extends java.lang.Object
    Convenience wrapper class around Field.

    Allows callers to invoke the wrapped method with all Exceptions wrapped by RuntimeException, or with a single Exception catch block.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DynFields.StaticField<T> asStatic()
      Returns this field as a StaticField.
      DynFields.BoundField<T> bind​(java.lang.Object target)
      Returns this method as a BoundMethod for the given receiver.
      T get​(java.lang.Object target)  
      boolean isAlwaysNull()
      Returns whether the field is always null.
      boolean isStatic()
      Returns whether the field is a static field.
      void set​(java.lang.Object target, T value)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • get

        public T get​(java.lang.Object target)
      • set

        public void set​(java.lang.Object target,
                        T value)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • bind

        public DynFields.BoundField<T> bind​(java.lang.Object target)
        Returns this method as a BoundMethod for the given receiver.
        Parameters:
        target - an Object on which to get or set this field
        Returns:
        a DynFields.BoundField for this field and the target
        Throws:
        java.lang.IllegalStateException - if the method is static
        java.lang.IllegalArgumentException - if the receiver's class is incompatible
      • isStatic

        public boolean isStatic()
        Returns whether the field is a static field.
      • isAlwaysNull

        public boolean isAlwaysNull()
        Returns whether the field is always null.