springboot配置通用枚举
时间: 2023-11-04 15:57:52 浏览: 207
在spring-boot-seed项目中,通用代码包中的configuration包负责springboot的配置注入。如果你想要配置通用枚举,可以在该包中创建一个枚举配置类,使用@Configuration注解标记该类为配置类,并使用@Bean注解将枚举转换处理器注册到spring容器中。在该处理器中,你可以使用泛型定义一个通用的枚举转换处理器,参考EnumOrdinalTypeHandler源码的写法。同时,你还可以定义一个枚举接口,用于方便泛型的使用和规范枚举类的实现。在处理器中,可以通过接口方法获取枚举的值。
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)