org.refcodes.mixin.ResultAccessor<String,RuntimeException>
public class ProcessResult extends Object implements org.refcodes.mixin.ResultAccessor<String,RuntimeException>
String
.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 | Description |
---|---|
ProcessResult(Process aProcess) |
Constructs a
ProcessResult instance which will synchronously
return the process' result via getResult() (and
toString() accordingly). |
ProcessResult(Process aProcess,
int aTimeoutMillis) |
Constructs a
ProcessResult instance which will synchronously
return the process' result via getResult() (and
toString() accordingly). |
public ProcessResult(Process aProcess) throws IOException
ProcessResult
instance which will synchronously
return the process' result via getResult()
(and
toString()
accordingly).aProcess
- The Process
from which to retrieve the result.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.public ProcessResult(Process aProcess, int aTimeoutMillis) throws InterruptedException, IOException
ProcessResult
instance which will synchronously
return the process' result via getResult()
(and
toString()
accordingly).aProcess
- The Process
from which to retrieve the result.aTimeoutMillis
- The time to wait till to terminate with an
InterruptedException
.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.public String getResult()
getResult
in interface org.refcodes.mixin.ResultAccessor<String,RuntimeException>
public boolean hasResult()
hasResult
in interface org.refcodes.mixin.ResultAccessor<String,RuntimeException>
Copyright © 2021. All rights reserved.