首页>代码>IDEA + maven + SpringAI + 讯飞星火大模型实现简单智能对话>/studyAI/src/main/java/cn/temptation/config/EnumReflectionUtil.java
package cn.temptation.config;

import java.lang.reflect.Field;

public class EnumReflectionUtil {
    public static void setEnumField(Enum<?> enumConstant, String fieldName, Object newValue) throws Exception {
        Field field = enumConstant.getClass().getDeclaredField(fieldName);
        field.setAccessible(true);
        field.set(enumConstant, newValue);
    }
}
最近下载更多
你是太阳  LV4 12月17日
最代码官方  LV168 11月15日
最近浏览更多
阿时23428  LV15 前天
tcy1111  LV1 12月28日
locklock  LV2 12月26日
刘先生-OL  LV13 12月22日
我们都是小怪兽  LV3 12月22日
lyerre  LV3 12月17日
你是太阳  LV4 12月17日
北城不夏  LV8 12月15日
GakkiMarryMe  LV9 12月13日
yunannan  LV2 12月8日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友