Stzx commented on a change in pull request #475: LANG-1495 Update EnumUtils.java
URL: https://github.com/apache/commons-lang/pull/475#discussion_r339407030
##########
File path: src/main/java/org/apache/commons/lang3/EnumUtils.java
##########
@@ -119,13 +119,29 @@ public EnumUtils() {
* @return the enum, null if not found
*/
public static <E extends Enum<E>> E getEnum(final Class<E> enumClass,
final String enumName) {
+ return getEnum(enumClass, enumName, null);
+ }
+
+ /**
+ * <p>Gets the enum for the class, returning {@code defaultEnum} if not
found.</p>
+ *
+ * <p>This method differs from {@link Enum#valueOf} in that it does not
throw an exception
+ * for an invalid enum name.</p>
+ *
+ * @param <E> the type of the enumeration
+ * @param enumClass the class of the enum to query, not null
+ * @param enumName the enum name, null returns default enum
+ * @param defaultEnum the default enum
+ * @return the enum, default enum if not found
Review comment:
Provide a `@since` tag for the new method.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services