Class BytecodeResult
- java.lang.Object
-
- com.tonic.analysis.execution.result.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BytecodeResultfailure(Throwable exception)Creates a failed result carrying the thrown exception.ThrowablegetException()ConcreteValuegetReturnValue()static BytecodeResultincomplete()Creates a result for an execution that neither completed nor threw.booleanisCompleted()booleanisFailure()booleanisSuccess()static BytecodeResultsuccess(ConcreteValue returnValue)Creates a completed result carrying a return value.StringtoString()
-
-
-
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
-
-