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
ConstructorDescriptionProcessResult
(Process aProcess) Constructs aProcessResult
instance which will synchronously return the process' result viagetResult()
(andtoString()
accordingly).ProcessResult
(Process aProcess, int aTimeoutMillis) Constructs aProcessResult
instance 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, wait
Methods inherited from interface org.refcodes.mixin.ResultAccessor
waitForResult
-
Constructor Details
-
ProcessResult
Constructs aProcessResult
instance which will synchronously return the process' result viagetResult()
(andtoString()
accordingly).- Parameters:
aProcess
- TheProcess
from 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 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:
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:
getResult
in interfaceorg.refcodes.mixin.ResultAccessor<String,
RuntimeException>
-
hasResult
public boolean hasResult()- Specified by:
hasResult
in interfaceorg.refcodes.mixin.ResultAccessor<String,
RuntimeException>
-
toString
-