Class ComboUtils

java.lang.Object
org.deltava.util.ComboUtils

public class ComboUtils extends Object
A utility class to generate combobox lists.
Since:
1.0
Version:
11.0
Author:
Luke
See Also:
  • Method Details

    • fromArray

      public static List<ComboAlias> fromArray(String... names)
      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

      public static List<ComboAlias> properCase(Enum<?>... names)
      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

      public static ComboAlias fromString(String name)
      Create a ComboAlias from a String. The name/alias will be the same.
      Parameters:
      name - the String
      Returns:
      a ComboAlias object
    • fromString

      public static ComboAlias fromString(String name, String alias)
      Create a ComboAlias from a name invalid input: '&' alias pair.
      Parameters:
      name - the name
      alias - the alias
      Returns:
      a ComboAlias object
    • fromList

      public static List<ComboAlias> fromList(Collection<?> names)
      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

      public static List<ComboAlias> fromMap(Map<String,Object> names)
      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

      public static List<ComboAlias> fromArray(String[] names, Object[] values)
      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 names
      values - an array of aliases.
      Returns:
      a List of ComboAlias objects
      Throws:
      ArrayIndexOutOfBoundsException - if names.length != values.length