Package org.apache.commons.cli
Class Util
- java.lang.Object
-
- org.apache.commons.cli.Util
-
final class Util extends java.lang.Object
Contains useful helper methods for classes within this package.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String[]
EMPTY_STRING_ARRAY
An empty immutableString
array.
-
Constructor Summary
Constructors Modifier Constructor Description private
Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static boolean
isEmpty(java.lang.Object[] array)
Tests whether the given array is null or empty.(package private) static boolean
isEmpty(java.lang.String str)
Tests whether the given string is null or empty.(package private) static java.lang.String
stripLeadingAndTrailingQuotes(java.lang.String str)
Removes the leading and trailing quotes fromstr
.(package private) static java.lang.String
stripLeadingHyphens(java.lang.String str)
Removes the hyphens from the beginning ofstr
and return the new String.
-
-
-
Method Detail
-
isEmpty
static boolean isEmpty(java.lang.Object[] array)
Tests whether the given array is null or empty.- Parameters:
array
- the array to test.- Returns:
- the given array is null or empty.
-
isEmpty
static boolean isEmpty(java.lang.String str)
Tests whether the given string is null or empty.- Parameters:
str
- The string to test.- Returns:
- Whether the given string is null or empty.
-
stripLeadingAndTrailingQuotes
static java.lang.String stripLeadingAndTrailingQuotes(java.lang.String str)
Removes the leading and trailing quotes fromstr
. E.g. if str is '"one two"', then 'one two' is returned.- Parameters:
str
- The string from which the leading and trailing quotes should be removed.- Returns:
- The string without the leading and trailing quotes.
-
stripLeadingHyphens
static java.lang.String stripLeadingHyphens(java.lang.String str)
Removes the hyphens from the beginning ofstr
and return the new String.- Parameters:
str
- The string from which the hyphens should be removed.- Returns:
- the new String.
-
-