com.mindbright.ssh2
public final class SSH2ListUtil extends java.lang.Object
Constructor and Description |
---|
SSH2ListUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
arrayFromList(java.lang.String list)
Convert a list expressed as a commaseparated string to an array.
|
static java.lang.String[] |
arrayFromList(java.lang.String list,
java.lang.String delim)
Convert a list expressed as a delimited string to an array.
|
static java.lang.String |
chooseFromList(java.lang.String clientList,
java.lang.String serverList)
Select the first entry in the clientList which also exists in
the server List.
|
static java.lang.String |
getFirstInList(java.lang.String list)
Get the first element of the list.
|
static boolean |
isInList(java.lang.String list,
java.lang.String element)
Checks if the given element is mentioned in the list.
|
static boolean |
isPrefixInList(java.lang.String list,
java.lang.String prefix)
Checks if the any element in the list starts with the given prefix.
|
static java.lang.String |
listFromArray(java.lang.String[] arr)
Convert an array of strings into a commaseparated string.
|
static java.lang.String |
removeAllFromList(java.lang.String list,
java.lang.String element)
Remove all instances of a specific element from list.
|
static java.lang.String |
removeAllPrefixFromList(java.lang.String list,
java.lang.String prefix)
Remove all elements which starts with the given string from list.
|
static java.lang.String |
removeFirstFromList(java.lang.String list,
java.lang.String element)
Remove the first instance of the given element from the list.
|
static java.lang.String |
sortList(java.lang.String list)
Sort the list alphabetically.
|
public static java.lang.String chooseFromList(java.lang.String clientList, java.lang.String serverList)
clientList
- List of keys to look for.serverList
- List to look in.public static java.lang.String removeAllFromList(java.lang.String list, java.lang.String element)
list
- List to remove elements from.element
- Element to remove.public static java.lang.String removeAllPrefixFromList(java.lang.String list, java.lang.String prefix)
list
- List to remove elements from.prefix
- Prefix of elements to remove.public static java.lang.String removeFirstFromList(java.lang.String list, java.lang.String element)
list
- List to remove element from.element
- Element to remove.public static java.lang.String getFirstInList(java.lang.String list)
list
- The list.null
if the list is empty.public static boolean isInList(java.lang.String list, java.lang.String element)
list
- List to look in.element
- Element to look for.public static boolean isPrefixInList(java.lang.String list, java.lang.String prefix)
list
- List to look in.prefix
- Prefix to look for.public static java.lang.String sortList(java.lang.String list)
list
- List to sort.public static java.lang.String[] arrayFromList(java.lang.String list)
list
- List to split.public static java.lang.String[] arrayFromList(java.lang.String list, java.lang.String delim)
list
- List to split.delim
- Delimiter.public static java.lang.String listFromArray(java.lang.String[] arr)
arr
- Array to convert.