com.smartgwt.client.util

## Class EnumUtil

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

-     public class EnumUtil
      extends java.lang.Object

  Utils for manipulate with a Enum.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EnumUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <TYPE extends ValueEnum> TYPE` | `getEnum(TYPE[] enums, java.lang.String value)` Get a enum item by value.
    `static <TYPE extends ValueEnum> ValueEnum[]` | `getEnums(TYPE[] enums, java.lang.String[] values)` Deprecated. use {`getEnums(ValueEnum[], String[], ValueEnum[])` method
    `static <TYPE extends ValueEnum> TYPE[]` | `getEnums(TYPE[] enums, java.lang.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 Detail

    - #### EnumUtil

          public EnumUtil()

  - ### Method Detail

    - #### getEnum

          public static <TYPE extends ValueEnum> TYPE getEnum(TYPE[] enums,
                                                              java.lang.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,
                                                                 java.lang.String[] values,
                                                                 TYPE[] result)

      Get a enum items by values.

      The java 1.6 does not support a 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.

      Parameters:
        `enums` - - enum items
        `values` - - enum values
        `result` - - array to store the result
      Returns:
        enum items

    - #### getEnums

          public static <TYPE extends ValueEnum> ValueEnum[] getEnums(TYPE[] enums,
                                                                      java.lang.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[])`