Class ComboUtils
java.lang.Object
org.deltava.util.ComboUtils
A utility class to generate combobox lists.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic List
<ComboAlias> Create a list of ComboAlias objects from an array of Strings.static List
<ComboAlias> Create a list of ComboAlias objects from an array of names and aliases.static List
<ComboAlias> fromList
(Collection<?> names) Create a list of ComboAlias objects from a List of objects.static List
<ComboAlias> Create a list of ComboAlias objects from a Map.static ComboAlias
fromString
(String name) Create a ComboAlias from a String.static ComboAlias
fromString
(String name, String alias) Create a ComboAlias from a name invalid input: '&' alias pair.static List
<ComboAlias> properCase
(Enum<?>... names) Create a list of ComboAlias objects from an array of Enumerations, propercasing the name.
-
Method Details
-
fromArray
Create a list of ComboAlias objects from an array of Strings. The name/alias will be the same.- Parameters:
names
- a variable number of Strings- Returns:
- a List of ComboAlias objects
- See Also:
-
properCase
Create a list of ComboAlias objects from an array of Enumerations, propercasing the name.- Parameters:
names
- a variable number of enums- Returns:
- a List of ComboAlias objects
-
fromString
Create a ComboAlias from a String. The name/alias will be the same.- Parameters:
name
- the String- Returns:
- a ComboAlias object
-
fromString
Create a ComboAlias from a name invalid input: '&' alias pair.- Parameters:
name
- the namealias
- the alias- Returns:
- a ComboAlias object
-
fromList
Create a list of ComboAlias objects from a List of objects. The name/alias will be the same.- Parameters:
names
- a List of names- Returns:
- a List of ComboAlias objects
-
fromMap
Create a list of ComboAlias objects from a Map. The keys will be the name, the values the aliases. The aliases need not be Strings; the toString() method will be called on them to get a String representation.- Parameters:
names
- a Map of name/value pairs- Returns:
- a List of ComboAlias Objects
- See Also:
-
fromArray
Create a list of ComboAlias objects from an array of names and aliases. The aliases need not be Strings. The toString() method will be called on them to get a String representation.- Parameters:
names
- an array of namesvalues
- an array of aliases.- Returns:
- a List of ComboAlias objects
- Throws:
ArrayIndexOutOfBoundsException
- if names.length != values.length
-