enum SetupWizardStep {
WORLD_CREATION("Please enter a world name for the island world");
private final String instruction;
SetupWizardStep(String instruction) {
this.instruction = instruction;
}
public String getInstruction() {
return instruction;
}
}
SetupWizardStep step = ...
int nextStep = step.ordinal() + 1;
if (nextStep < values.length) {
this.step = values[nextStep];
}
i have an enum that represents steps in a wizard. i want to use values() and orindal to determine the next step, but this means the enum has to be in step order. is this code fragile? would it be better to explicitly define the order in the constructor or the next step?