Package com.smartgwt.client.util

# Class EnumUtil

java.lang.Object
com.smartgwt.client.util.EnumUtil

public class EnumUtil extends Object
Utils for manipulate with a Enum.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EnumUtil()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static <TYPE extends ValueEnum>
  TYPE`
  `getEnum(TYPE[] enums, String value)`
  Get a enum item by value.
  `static <TYPE extends ValueEnum>
  ValueEnum[]`
  `getEnums(TYPE[] enums, String[] values)`
  Deprecated.
  use {`getEnums(ValueEnum[], String[], ValueEnum[])` method
  `static <TYPE extends ValueEnum>
  TYPE[]`
  `getEnums(TYPE[] enums, String[] values, TYPE[] result)`
  Get a enum items by values.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EnumUtil

    public EnumUtil()

- ## Method Details

  - ### getEnum

    public static <TYPE extends ValueEnum> TYPE getEnum(TYPE[] enums, String value)
    Get a enum item by value.
    Parameters:
      `enums` - - enum items
      `value` - - enum value
    Returns:
      enum item
    See Also:
      - `ValueEnum`

  - ### getEnums

    public static <TYPE extends ValueEnum> TYPE[] getEnums(TYPE[] enums, String[] values, TYPE[] result)
    Get a enum items by values.

    The java 1.6 does not support a code " {@code (TYPE[]) new Object[values.length];". Also, the GWT does not support a reflection api ( {@link java.lang.reflect.Array#newInstance}). So you need to pass an array argument to store the result. @param enums - enum items @param values - enum values @param result - array to store the result @return enum items

  - ### getEnums

    public static <TYPE extends ValueEnum> ValueEnum[] getEnums(TYPE[] enums, String[] values)
    Deprecated.
    use {`getEnums(ValueEnum[], String[], ValueEnum[])` method
    Get a enum items by values.

    This method is not compatible with the java 1.6.

    Parameters:
      `enums` - - enum items
      `values` - - enum values
    Returns:
      enum items
    See Also:
      - `getEnums(ValueEnum[], String[], ValueEnum[])`