Is there an efficient way to find all possible combinations between multiple enums in Java?
Consider the following three listings:
public enum EnumOne { One ("One"), OneMore ("OneMore"); } public enum EnumTwo { Two ("Two"), } public enum EnumThree { Three ("Three"), ThreeMore ("ThreeMore"); }
I would like the result to produce all possible combinations between these multiple enumerations i.e.
{EnumOne.One, EnumTwo.Two, EnumThree.Three}, {EnumOne.One, EnumTwo.Two, EnumThree.ThreeMore}, {EnumOne.OneMore, EnumTwo.Two, EnumThree.Three}, {EnumOne.OneMore, EnumTwo.Two, EnumThree.ThreeMore}
Hoping to find an effective way to handle it.
thanks
source share