Class EnumUtils

java.lang.Object
org.sejda.conversion.EnumUtils

public final class EnumUtils extends Object
Utilities related to Enums
Author:
Eduard Weissmann
  • Method Details

    • valueOfSilently

      public static <T extends Enum<?> & FriendlyNamed> T valueOfSilently(Class<T> enumClass, String displayName)
      Parameters:
      enumClass -
      displayName -
      Returns:
      Returns the enum value matching the input displayName, belonging to the specified enum class Does not throw an exception if enum value is not found, returns null
    • valueOf

      public static <T extends Enum<?> & FriendlyNamed> T valueOf(Class<T> enumClass, String displayName, String describedEnumClass)
      Parameters:
      enumClass -
      displayName -
      describedEnumClass -
      Returns:
      Returns the enum value matching the input displayName, belonging to the specified enum class
      Throws:
      SejdaRuntimeException - if enum value is not found, mentioning the valid values in the message