# java
public class B extends Enum implements TEnum {
B a = new B("a", 1, 1);
B b = new B("b", 2, 5);
int val;
public B(String s, int i, int val) {
super(s, i);
this.val = val;
}
}
How should I define the above structure in thrift?
In Thrift an enum is simply an integer. It's not possible to have more complex structures on top of it.
Remember that Thrift is compatible to 20+ target languages and dialects and most environments do not have the capability to do such stuff like having two values on an enum. To model that with Thrift consider using a struct