code: public <TEnum extends Enum<TEnum>> TEnum getEnum(String key, Class<TEnum> enumClass, TEnum defaultValue)
      {
          String name = getString(key);
  
          if (name == null)
          {
              return defaultValue;
          }
  
          try
          {
              return Enum.valueOf(enumClass, name);
          }
          catch (RuntimeException e)
          {
              return defaultValue;
          }
      }
docs: Get the value of the property identified by the key as Enum.
  If {@code key} is null or there is no property for the key,
  {@code defaultValue} is returned.