# enumx
**Repository Path**: maarlakes/enumx
## Basic Information
- **Project Name**: enumx
- **Description**: 提供枚举值的统一接口,枚举值扩展接口,以及一些常见的枚举工具方法。
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 2
- **Forks**: 0
- **Created**: 2023-11-16
- **Last Updated**: 2024-08-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
> enumx 提供枚举值的统一接口,枚举值扩展接口,以及一些常见的枚举工具方法。
## 依赖
```xml
cn.maarlakes
enumx
1.0.3
```
- 统一的枚举值接口 EnumValue, 并提供默认的 Jackson 序列号模块 EnumModule,可以通过 SPI 注册
- Enums 提供一组 valueOf 方法以简化枚举值查找
### EnumValue 示例
```java
import cn.marrlakes.enumx.EnumValue;
public enum ExampleEnum implements EnumValue {
A(1), B(2);
private final int value;
private ExampleEnum(int value) {
this.value = value;
}
@Override
public Integer value() {
return this.value;
}
public static ExampleEnum valueOf(int value) {
return EnumValue.valueOf(ExampleEnum.class, value);
}
}
```