code: public static String enumToString(final Enum<?> value) {
  
      if (value == null) {
        return null;
      }
  
      final String underscored = value.name();
  
      final StringBuilder sb = new StringBuilder();
      for (int i = 0; i < underscored.length(); i++) {
        final char c = underscored.charAt(i);
        if (c == '_') {
          sb.append(Character.toUpperCase(underscored.charAt(++i)));
        } else {
          sb.append(Character.toLowerCase(c));
        }
      }
      return sb.toString();
    }
docs: Convert an enumeration to a String representation.