Class EnumUtils

java.lang.Object
org.carrot2.util.EnumUtils

public class EnumUtils extends Object
Various utility methods for working with Java 5 enum types.
  • Method Details

    • valueOf

      public static <T extends Enum<T>> T valueOf(String name, Class<T> enumClass, T defaultValue)
      Returns the enum instance corresponding to the provided name or defaultValue if no enum value corresponds to name.
      Type Parameters:
      T - the generic type
      Parameters:
      name - the name
      enumClass - the enum class
      defaultValue - the default value
      Returns:
      the t