Class ArgumentUtil
java.lang.Object
de.chojo.jdautil.parsing.ArgumentUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetMessage(String[] strings, int from) Get a message from string array from 'from' to array.length().static StringgetMessage(String[] strings, int from, int to) Get a message from string array from 'from' to 'to'.static <T> List<T> getRangeAsList(List<T> objects, int from) Get a sublist from 'from' to list.size()static <T> List<T> getRangeAsList(List<T> objects, int from, int to) Get a sublist of a list.static <T> List<T> getRangeAsList(T[] objects, int from) Get a array as sublist from 'from' to array.length().static <T> List<T> getRangeAsList(T[] objects, int from, int to) Get a sublist from array from 'from' to 'to'.static String[]parseQuotedArgs(String[] args) Parse arguments and keep quotes togetherstatic String[]parseQuotedArgs(String args, boolean strip)
-
Constructor Details
-
ArgumentUtil
public ArgumentUtil()
-
-
Method Details
-
parseQuotedArgs
-
parseQuotedArgs
-
getMessage
-
getMessage
Get a message from string array from 'from' to 'to'.- Parameters:
strings- array of strings.from- start index (included). Use negative counts to count from the last index.to- end index (excluded). Use negative counts to count from the last index.- Returns:
- array sequence as string
-
getRangeAsList
Get a array as sublist from 'from' to array.length().- Type Parameters:
T- Type of objects- Parameters:
objects- argumentsfrom- start index included- Returns:
- sublist
-
getRangeAsList
Get a sublist from array from 'from' to 'to'.- Type Parameters:
T- Type of objects- Parameters:
objects- list of objects.from- start index (included). Use negative counts to count from the last index.to- end index (excluded). Use negative counts to count from the last index.- Returns:
- sublist.
-
getRangeAsList
-
getRangeAsList
Get a sublist of a list.- Type Parameters:
T- Type of objects- Parameters:
objects- list of objects.from- start index (included). Use negative counts to count from the last index.to- end index (excluded). Use negative counts to count from the last index.- Returns:
- sublist.
-