Class Shell.Result

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>
    Enclosing class:
    Shell

    public static final class Shell.Result
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.String>
    The Shell.execute(Charset, String...) command execution result.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.lang.String> commandLines  
      private int exitCode  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Result​(int exitCode, java.util.List<java.lang.String> commandLines)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int exitCode()
      Gets the process exit code.
      java.util.Iterator<java.lang.String> iterator()
      Gets an iterator over the captured stdout/stderr lines.
      java.util.List<java.lang.String> lines()
      Gets the list holding the captured stdout/stderr lines.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • commandLines

        private final java.util.List<java.lang.String> commandLines
      • exitCode

        private final int exitCode
    • Constructor Detail

      • Result

        private Result​(int exitCode,
                       java.util.List<java.lang.String> commandLines)
    • Method Detail

      • exitCode

        public int exitCode()
        Gets the process exit code.
        Returns:
        the process exit code
      • lines

        public java.util.List<java.lang.String> lines()
        Gets the list holding the captured stdout/stderr lines.
        Returns:
        an unmodifiable list of the captured output lines
      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Gets an iterator over the captured stdout/stderr lines.
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>
        Returns:
        a new Iterator over the stdout/stderr lines