Class ArgumentReader

    • Field Detail

      • commandList

        protected final List<String> commandList
    • Constructor Detail

      • ArgumentReader

        protected ArgumentReader​(boolean parseEnv,
                                 String... args)
        Parses a string arguments into key value
        Parameters:
        args - strings with arguments
    • Method Detail

      • getCommand

        public String getCommand()
        get command
        Returns:
        command
      • getCommand

        public String getCommand​(int index)
        get command
        Parameters:
        index - number of command
        Returns:
        command or null if no command were found
      • getCommands

        public List<String> getCommands()
        get commands
        Returns:
        all commands
      • hasCommand

        public boolean hasCommand​(String command)
        has command
        Returns:
        true if command exists
      • isPresent

        public boolean isPresent​(String... keys)
        isPresent
        Parameters:
        keys - search for
        Returns:
        true if one key is present
      • getString

        public Optional<String> getString​(String separator,
                                          int index,
                                          String... keys)
        getString
        Parameters:
        keys - search for
        index - number of value
        separator - handles values as list if present
        Returns:
        returns Optional value or Optional.empty() if no value is present
      • getStrings

        public List<String> getStrings​(String... keys)
        getStrings
        Parameters:
        keys - search for
        Returns:
        returns values or empty list if no value is present
      • getStrings

        public List<String> getStrings​(char separator,
                                       String... keys)
        getStrings
        Parameters:
        keys - search for
        separator - handles values as list if present
        Returns:
        returns values or empty list if no value is present
      • getStrings

        public List<String> getStrings​(String separator,
                                       String[] keys)
        getStrings
        Parameters:
        keys - search for
        separator - handles values as list if present
        Returns:
        returns values or empty list if no value is present
      • getBoolean

        public boolean getBoolean​(String... keys)
        getBoolean
        Parameters:
        keys - search for
        Returns:
        true if [value == 1], [value == true], [key != && value == null]
      • getBoolean

        public boolean getBoolean​(int index,
                                  String... keys)
        getBoolean
        Parameters:
        keys - search for
        index - number of value
        Returns:
        true if [value == 1], [value == true], [key != && value == null]
      • getBoolean

        public boolean getBoolean​(String separator,
                                  int index,
                                  String... keys)
        getBoolean
        Parameters:
        keys - search for
        index - number of value
        separator - handles values as list if present
        Returns:
        true if [value == 1], [value == true], [key != && value == null]
      • getBooleans

        public List<Boolean> getBooleans​(String... keys)
        getBoolean
        Parameters:
        keys - search for
        Returns:
        boolean list if [value == 1], [value == true]
      • getBooleans

        public List<Boolean> getBooleans​(String separator,
                                         String[] keys)
        getBoolean
        Parameters:
        keys - search for
        separator - handles values as list if present
        Returns:
        boolean list if [value == 1], [value == true]
      • getLong

        public Optional<Long> getLong​(int index,
                                      String... keys)
        getLong
        Parameters:
        keys - search for
        index - number of value
        Returns:
        Optional of Long if [value is an integer]
      • getLong

        public Optional<Long> getLong​(String separator,
                                      int index,
                                      String... keys)
        getLong
        Parameters:
        keys - search for
        index - number of value
        separator - handles values as list if present
        Returns:
        Optional of Long if [value is an integer]
      • getLongs

        public List<Long> getLongs​(String... keys)
        getLongs
        Parameters:
        keys - search for
        Returns:
        Optional of Long if [value is an integer]
      • getLongs

        public List<Long> getLongs​(char separator,
                                   String... keys)
        getLongs
        Parameters:
        keys - search for
        separator - handles values as list if present
        Returns:
        Optional of Long if [value is an integer]
      • getLongs

        public List<Long> getLongs​(String separator,
                                   String[] keys)
        getLongs
        Parameters:
        keys - search for
        separator - handles values as list if present
        Returns:
        Optional of Long if [value is an integer]
      • getDouble

        public Optional<Double> getDouble​(int index,
                                          String... keys)
        getDouble
        Parameters:
        keys - search for
        index - number of value
        Returns:
        Optional of Long if [value is an integer]
      • getDouble

        public Optional<Double> getDouble​(String separator,
                                          int index,
                                          String... keys)
        getDouble
        Parameters:
        keys - search for
        index - number of value
        separator - handles values as list if present
        Returns:
        Optional of Long if [value is an integer]
      • getDoubles

        public List<Double> getDoubles​(String... keys)
        getDoubles
        Parameters:
        keys - search for
        Returns:
        Optional of Long if [value is an integer]
      • getDoubles

        public List<Double> getDoubles​(char separator,
                                       String... keys)
        getDoubles
        Parameters:
        keys - search for
        separator - handles values as list if present
        Returns:
        Optional of Long if [value is an integer]
      • getDoubles

        public List<Double> getDoubles​(String separator,
                                       String[] keys)
        getDoubles
        Parameters:
        keys - search for
        separator - handles values as list if present
        Returns:
        Optional of Long if [value is an integer]
      • get

        public List<String> get​(String key)
        get
        Parameters:
        key - search for
        Returns:
        list of values or empty list if not found
      • get

        public List<String> get​(String separator,
                                String key)
        get
        Parameters:
        key - search for
        separator - handles values as list if present
        Returns:
        list of values or empty list if not found
      • parseCommands

        protected String parseCommands​(String input)
      • getStripedValue

        protected String getStripedValue​(String value)
      • parseToKeyValue

        protected String[] parseToKeyValue​(String argument)
      • getValue

        protected String getValue​(String separator,
                                  int index,
                                  String... keys)
        getValue
        Parameters:
        keys - search for
        index - number of value
        separator - handles values as list if present
        Returns:
        value or null if no value was found