I have an enum:
public enum X implements Y
I also have a class
Ybuilder which can create instances of Y, let's say with Ybuilder.create(int value)
How can I set the enum values in my enum to be instances of Y created with Ybuilder? ideally it would be something simple like
public enum X implements Y {
A (Ybuilder.create(0)),
B (Ybuilder.create(1)),
};
Xshould have a constructor that takesYas parameter typeTthat you can set