Class DynMethods.UnboundMethod

  • Direct Known Subclasses:
    DynConstructors.Ctor
    Enclosing class:
    DynMethods

    public static class DynMethods.UnboundMethod
    extends java.lang.Object
    Convenience wrapper class around Method.

    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
      DynMethods.StaticMethod asStatic()
      Returns this method as a StaticMethod.
      DynMethods.BoundMethod bind​(java.lang.Object receiver)
      Returns this method as a BoundMethod for the given receiver.
      <R> R invoke​(java.lang.Object target, java.lang.Object... args)  
      <R> R invokeChecked​(java.lang.Object target, java.lang.Object... args)  
      boolean isNoop()
      Returns whether the method is a noop.
      boolean isStatic()
      Returns whether the method is a static method.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • invokeChecked

        public <R> R invokeChecked​(java.lang.Object target,
                                   java.lang.Object... args)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • invoke

        public <R> R invoke​(java.lang.Object target,
                            java.lang.Object... args)
      • bind

        public DynMethods.BoundMethod bind​(java.lang.Object receiver)
        Returns this method as a BoundMethod for the given receiver.
        Parameters:
        receiver - an Object to receive the method invocation
        Returns:
        a DynMethods.BoundMethod for this method and the receiver
        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 method is a static method.
      • isNoop

        public boolean isNoop()
        Returns whether the method is a noop.
      • toString

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