Class ProcessRunner.Result

  • Enclosing class:
    ProcessRunner

    public static class ProcessRunner.Result
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Result​(java.util.List<java.lang.String> args, int exitCode, byte[] stdOut, byte[] stdErr)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> args()  
      java.lang.String assertExitZero​(java.nio.charset.Charset charset)
      Asserts that the exit code was zero, and if so, returns the content of stdout encoded with the given charset.
      int exitCode()  
      boolean exitNotZero()
      Returns true if the exit code was not zero.
      byte[] stdErr()  
      java.lang.String stdErrUtf8()  
      byte[] stdOut()  
      java.lang.String stdOutUtf8()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Result

        public Result​(@Nonnull
                      java.util.List<java.lang.String> args,
                      int exitCode,
                      @Nonnull
                      byte[] stdOut,
                      @Nullable
                      byte[] stdErr)
    • Method Detail

      • args

        public java.util.List<java.lang.String> args()
      • exitCode

        public int exitCode()
      • stdOut

        public byte[] stdOut()
      • stdErr

        public byte[] stdErr()
      • stdOutUtf8

        public java.lang.String stdOutUtf8()
      • stdErrUtf8

        public java.lang.String stdErrUtf8()
      • exitNotZero

        public boolean exitNotZero()
        Returns true if the exit code was not zero.
      • assertExitZero

        public java.lang.String assertExitZero​(java.nio.charset.Charset charset)
        Asserts that the exit code was zero, and if so, returns the content of stdout encoded with the given charset. If the exit code was not zero, throws an exception with useful debugging information.
      • toString

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