java.lang.Object
org.refcodes.runtime.ProcessResult
- All Implemented Interfaces:
org.refcodes.mixin.ResultAccessor<String,RuntimeException>
public class ProcessResult
extends Object
implements org.refcodes.mixin.ResultAccessor<String,RuntimeException>
Retrieves the Result of the given process as
String.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ResultAccessor
org.refcodes.mixin.ResultAccessor.ResultBuilder<RES extends Object,B extends org.refcodes.mixin.ResultAccessor.ResultBuilder<RES, B>>, org.refcodes.mixin.ResultAccessor.ResultMutator<RES extends Object>, org.refcodes.mixin.ResultAccessor.ResultProperty<RES extends Object, EXC extends Exception> -
Constructor Summary
ConstructorsConstructorDescriptionProcessResult(Process aProcess) Constructs aProcessResultinstance which will synchronously return the process' result viagetResult()(andtoString()accordingly).ProcessResult(Process aProcess, int aTimeoutMillis) Constructs aProcessResultinstance which will synchronously return the process' result viagetResult()(andtoString()accordingly). -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.mixin.ResultAccessor
waitForResult
-
Constructor Details
-
ProcessResult
Constructs aProcessResultinstance which will synchronously return the process' result viagetResult()(andtoString()accordingly).- Parameters:
aProcess- TheProcessfrom which to retrieve the result.- Throws:
IOException- Thrown in case there were problems retrieving the result. If possible, the error stream of the process is captured in the exception's message.
-
ProcessResult
Constructs aProcessResultinstance which will synchronously return the process' result viagetResult()(andtoString()accordingly).- Parameters:
aProcess- TheProcessfrom which to retrieve the result.aTimeoutMillis- The time to wait till to terminate with anInterruptedException.- Throws:
IOException- Thrown in case there were problems retrieving the result. If possible, the error stream of the process is capturedInterruptedException- Thrown in case the timeout has exceeded before process' termination.
-
-
Method Details
-
getResult
- Specified by:
getResultin interfaceorg.refcodes.mixin.ResultAccessor<String,RuntimeException>
-
hasResult
public boolean hasResult()- Specified by:
hasResultin interfaceorg.refcodes.mixin.ResultAccessor<String,RuntimeException>
-
toString
-