Class BytecodeResult


  • public final class BytecodeResult
    extends Object
    Outcome of a bytecode execution: a return value on success, a thrown exception on failure, or an incomplete run.
    • Method Detail

      • success

        public static BytecodeResult success​(ConcreteValue returnValue)
        Creates a completed result carrying a return value.
        Parameters:
        returnValue - the returned value, or null for void
        Returns:
        the success result
      • failure

        public static BytecodeResult failure​(Throwable exception)
        Creates a failed result carrying the thrown exception.
        Parameters:
        exception - what execution threw
        Returns:
        the failure result
      • incomplete

        public static BytecodeResult incomplete()
        Creates a result for an execution that neither completed nor threw.
        Returns:
        the incomplete result
      • getReturnValue

        public ConcreteValue getReturnValue()
        Returns:
        the return value
      • getException

        public Throwable getException()
        Returns:
        the exception
      • isCompleted

        public boolean isCompleted()
        Returns:
        whether completed
      • isSuccess

        public boolean isSuccess()
        Returns:
        true if execution completed without an exception
      • isFailure

        public boolean isFailure()
        Returns:
        true if an exception was recorded