Package org.refcodes.runtime
Class ProcessResult
- java.lang.Object
-
- org.refcodes.runtime.ProcessResult
-
- All Implemented Interfaces:
org.refcodes.mixin.ResultAccessor<java.lang.String>
public class ProcessResult extends java.lang.Object implements org.refcodes.mixin.ResultAccessor<java.lang.String>
Retrieves the Result of the given process asString
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.ResultAccessor
org.refcodes.mixin.ResultAccessor.ResultBuilder<RES extends java.lang.Object,B extends org.refcodes.mixin.ResultAccessor.ResultBuilder<RES,B>>, org.refcodes.mixin.ResultAccessor.ResultMutator<RES extends java.lang.Object>, org.refcodes.mixin.ResultAccessor.ResultProperty<RES extends java.lang.Object>
-
-
Constructor Summary
Constructors Constructor Description ProcessResult(java.lang.Process aProcess)
Constructs aProcessResult
instance which will synchronously return the process' result viagetResult()
(andtoString()
accordingly).ProcessResult(java.lang.Process aProcess, int aTimeOutMillis)
Constructs aProcessResult
instance which will synchronously return the process' result viagetResult()
(andtoString()
accordingly).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getResult()
java.lang.String
toString()
-
-
-
Constructor Detail
-
ProcessResult
public ProcessResult(java.lang.Process aProcess) throws java.io.IOException
Constructs aProcessResult
instance which will synchronously return the process' result viagetResult()
(andtoString()
accordingly).- Parameters:
aProcess
- TheProcess
from which to retrieve the result.- Throws:
java.io.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
public ProcessResult(java.lang.Process aProcess, int aTimeOutMillis) throws java.lang.InterruptedException, java.io.IOException
Constructs aProcessResult
instance which will synchronously return the process' result viagetResult()
(andtoString()
accordingly).- Parameters:
aProcess
- TheProcess
from which to retrieve the result.aTimeOutMillis
- The time to wait till to terminate with anInterruptedException
.- Throws:
java.io.IOException
- Thrown in case there were problems retrieving the result. If possible, the error stream of the process is capturedjava.lang.InterruptedException
- Thrown in case the timeout has exceeded before process' termination.
-
-