Class EnumUtil


  • public final class EnumUtil
    extends java.lang.Object
    Simple enum utilities.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static EnumUtil getInstance()
      Get the instance
      <T extends java.lang.Enum<T>>
      T
      valueOf​(java.lang.Class<T> enumType, java.lang.String name)
      Returns the enum constant of the specified enum type with the specified name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static EnumUtil getInstance()
        Get the instance
        Returns:
        the instance
      • valueOf

        public <T extends java.lang.Enum<T>> T valueOf​(java.lang.Class<T> enumType,
                                                       java.lang.String name)
        Returns the enum constant of the specified enum type with the specified name. The name must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Type Parameters:
        T - the type
        Parameters:
        enumType - the Class object of the enum type from which to return a constant
        name - the name of the constant to return
        Returns:
        the enum constant of the specified enum type with the specified name