ui

## Class NonInteractiveCLI

- java.lang.Object
- - ui.NonInteractiveCLI

-     public class NonInteractiveCLI
      extends java.lang.Object

  Used as a container for machine mode CLI switches. Provides their usage and implementation. Some of the objects and methods below use Apache Commons CLI (https://commons.apache.org/proper/commons-cli/).
  Author:
    David Hudec (dwdization@gmail.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.lang.StringBuilder` | `enumTexts`
    `private org.apache.commons.cli.HelpFormatter` | `formatter`
    `private Frame` | `frame`
    `private org.apache.commons.cli.CommandLine` | `line`
    `private org.apache.commons.cli.Options` | `options`
    `private org.apache.commons.cli.CommandLineParser` | `parser`
    `private CLI.CLIPeriodicTelegram` | `pt`
    `private Sender` | `sender`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NonInteractiveCLI()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private java.lang.Boolean` | `getBoolean(java.lang.String opt)`
    `private java.lang.Byte` | `getByte(java.lang.String opt)`
    `private java.lang.Byte[]` | `getBytes(java.lang.String opt)`
    `private java.lang.String` | `getDstIp()`
    `private int` | `getDstPort()`
    `private <E extends java.lang.Enum<E>> E` | `getEnumOption(java.lang.Class<E> e, java.lang.String opt)` Generic method for all enums.
    `private int` | `getInt(java.lang.String opt)`
    `private java.lang.String` | `getSrcIp()`
    `private int` | `getSrcPort()`
    `private java.lang.String` | `getString(java.lang.String opt)`
    `NonInteractiveCLI` | `init()` Initiates the CLI with the list of options.
    `private static void` | `parseEnumValues()` Iterates through all enums used in the class and processes them for further usage.
    `void` | `run(java.lang.String[] args)` Runs the argument processor, evaluates the inputs and takes respective actions.

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

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

- - ### Field Detail

    - #### enumTexts

          private static java.lang.StringBuilder enumTexts

    - #### formatter

          private org.apache.commons.cli.HelpFormatter formatter

    - #### frame

          private Frame frame

    - #### line

          private org.apache.commons.cli.CommandLine line

    - #### options

          private org.apache.commons.cli.Options options

    - #### parser

          private org.apache.commons.cli.CommandLineParser parser

    - #### pt

          private CLI.CLIPeriodicTelegram pt

    - #### sender

          private Sender sender

  - ### Constructor Detail

    - #### NonInteractiveCLI

          public NonInteractiveCLI()

  - ### Method Detail

    - #### getBoolean

          private java.lang.Boolean getBoolean(java.lang.String opt)

    - #### getByte

          private java.lang.Byte getByte(java.lang.String opt)

    - #### getBytes

          private java.lang.Byte[] getBytes(java.lang.String opt)

    - #### getDstIp

          private java.lang.String getDstIp()

    - #### getDstPort

          private int getDstPort()

    - #### getEnumOption

          private <E extends java.lang.Enum<E>> E getEnumOption(java.lang.Class<E> e,
                                                                java.lang.String opt)

      Generic method for all enums. Picks the selected option from given enumeration, identified by given option.
      Type Parameters:
        `E` - enum subject
      Parameters:
        `e` - enum to pick from
        `opt` - option switch identifier
      Returns:
        value from enum e, chosen by the user with switch opt

    - #### getInt

          private int getInt(java.lang.String opt)

    - #### getSrcIp

          private java.lang.String getSrcIp()

    - #### getSrcPort

          private int getSrcPort()

    - #### getString

          private java.lang.String getString(java.lang.String opt)

    - #### init

          public NonInteractiveCLI init()

      Initiates the CLI with the list of options.
      Returns:
        this instance

    - #### parseEnumValues

          private static void parseEnumValues()

      Iterates through all enums used in the class and processes them for further usage.

    - #### run

          public void run(java.lang.String[] args)

      Runs the argument processor, evaluates the inputs and takes respective actions.
      Parameters:
        `args` - CLI program arguments