if the method annotated with @ThriftEnumValue is a method overriding generic super method which return type is generic ,then the ThriftEnumMetadata's constructor will check its bridge method's return type and raise an Exception
add these code to the TestThriftEnumMetadata.java and it will show the Exception
public interface CodeInterface<T> {
T getCode();
}
@ThriftEnum
public enum CodeWithBridgeEnum implements CodeInterface<Integer> {
A(1),;
private final Integer code;
CodeWithBridgeEnum(Integer code) {
this.code = code;
}
@ThriftEnumValue
@Override
public Integer getCode() {
return code;
}
}
@Test
public void testCodeWithBridgeEnum() {
thriftEnumMetadata(CodeWithBridgeEnum.class);
}
if the method annotated with @ThriftEnumValue is a method overriding generic super method which return type is generic ,then the ThriftEnumMetadata's constructor will check its bridge method's return type and raise an Exception
add these code to the TestThriftEnumMetadata.java and it will show the Exception