org.appng.tools.os

## Class StringConsumer

- java.lang.Object
- - org.appng.tools.os.StringConsumer

- All Implemented Interfaces:
    Command.StreamConsumer<List<String>>

      public class StringConsumer
      extends Object
      implements Command.StreamConsumer<List<String>>

  Basic `StringConsumer`-implementation which reads from an `InputStream` line-by-line and stores the result in a `List` of `String`s.
  Author:
    Matthias Müller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringConsumer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `consume(InputStream is)` Consumes the given `InputStream`.
    `List<String>` | `getResult()` Returns the result for this `StreamConsumer`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StringConsumer

          public StringConsumer()

  - ### Method Detail

    - #### consume

          public void consume(InputStream is)
                       throws IOException

      Description copied from interface: `Command.StreamConsumer`
      Consumes the given `InputStream`.
      Specified by:
        `consume` in interface `Command.StreamConsumer<List<String>>`
      Parameters:
        `is` - the `InputStream` to consume
      Throws:
        `IOException` - if an error occurs while consuming

    - #### getResult

          public List<String> getResult()

      Description copied from interface: `Command.StreamConsumer`
      Returns the result for this `StreamConsumer`.
      Specified by:
        `getResult` in interface `Command.StreamConsumer<List<String>>`
      Returns:
        the result of type `<T>`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.