org.cli4j.util
Class StringUtils

java.lang.Object
  |
  +--org.cli4j.util.StringUtils

public final class StringUtils
extends java.lang.Object

A collection of useful string utility functions.


Constructor Summary
StringUtils()
           
 
Method Summary
static java.lang.String join(java.lang.String[] strings, java.lang.String joinStr)
          Constructs a single string by concatenating the args array element with the joinStr between each element.
static java.util.Map parseCmdArgs(java.lang.String[] args)
          Scan an array of stirngs, where argument names start with a dash ("-") and values are the next element in the array if it does not start with an dash.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

parseCmdArgs

public static java.util.Map parseCmdArgs(java.lang.String[] args)
Scan an array of stirngs, where argument names start with a dash ("-") and values are the next element in the array if it does not start with an dash. If the next element does start with a dash (and thus is presumably another argument) the argument value is null.
Parameters:
args - The argument array, typcially what gets passed into a main method.
Returns:
the map of arguments and values.

join

public static java.lang.String join(java.lang.String[] strings,
                                    java.lang.String joinStr)
Constructs a single string by concatenating the args array element with the joinStr between each element.