管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-25 b6b0cb226fcf184525ee7b36af3a09471e9c0057
src/main/java/com/lf/server/helper/EnumHelper.java
@@ -34,7 +34,7 @@
     * @return 返回枚举值
     */
    public static <T extends Enum<T>> T getByString(Class<T> clazz, String propertyName, String value) {
        String getterMethodName = GETTER_PREFIX + StringHelper.capitalize(propertyName);
        String getterMethodName = GETTER_PREFIX + StringHelper.firstCharToUpperCase(propertyName);
        T result = null;
        try {
            T[] arr = clazz.getEnumConstants();
@@ -48,8 +48,9 @@
                }
            }
        } catch (Exception ex) {
            log.error(ex.getMessage() + ex.getStackTrace() + "\n");
            log.error(ex.getMessage(), ex);
        }
        return result;
    }
@@ -62,7 +63,7 @@
     * @return 返回枚举值
     */
    public static <T extends Enum<T>> T getByInt(Class<T> clazz, String propertyName, int value) {
        String getterMethodName = GETTER_PREFIX + StringHelper.capitalize(propertyName);
        String getterMethodName = GETTER_PREFIX + StringHelper.firstCharToUpperCase(propertyName);
        T result = null;
        try {
            T[] arr = clazz.getEnumConstants();
@@ -76,7 +77,7 @@
                }
            }
        } catch (Exception ex) {
            log.error(ex.getMessage() + ex.getStackTrace() + "\n");
            log.error(ex.getMessage(), ex);
        }
        return result;
    }