Class 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 as String.
    • 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>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getResult​()
      java.lang.String toString​()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ProcessResult

        public ProcessResult​(java.lang.Process aProcess)
                      throws java.io.IOException
        Constructs a ProcessResult instance which will synchronously return the process' result via getResult() (and toString() accordingly).
        Parameters:
        aProcess - The Process 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 a ProcessResult instance which will synchronously return the process' result via getResult() (and toString() accordingly).
        Parameters:
        aProcess - The Process from which to retrieve the result.
        aTimeOutMillis - The time to wait till to terminate with an InterruptedException.
        Throws:
        java.io.IOException - Thrown in case there were problems retrieving the result. If possible, the error stream of the process is captured
        java.lang.InterruptedException - Thrown in case the timeout has exceeded before process' termination.
    • Method Detail

      • getResult

        public java.lang.String getResult​()
        Specified by:
        getResult in interface org.refcodes.mixin.ResultAccessor<java.lang.String>
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object