@AllArgsConstructor
@Getter
public enum MemberType {
INTERN("name_intern", 1),
EMPLOYEE("name_employee", 10);
private String name;
private int workingMonth;
}
Here is my enum. I want to convert Enum class to JSON string with some constraint.
- I want to MemberType has no dependency with Jackson
- I want to convert
MemberType.INTERNto{id:INTERN, name:"name_intern", workingMonth:10}. - I have lots of Enums want to convert like above. And Their number of property is different each other.
- I want resolve this problem through just one global configuration.
- I don't want to use explicit java reflection.
Is there a solution that meets the above constraints?