I have a method lets say:
private static String drawCellValue(
int maxCellLength, String cellValue, String align) { }
and as you can no
Even cooler with enums you can use switch:
switch (align) {
case LEFT: {
// do stuff
break;
}
case RIGHT: {
// do stuff
break;
}
default: { //added TOP_RIGHT but forgot about it?
throw new IllegalArgumentException("Can't yet handle " + align);
}
}
Enums are cool because the output of the exception will be the name of the enum value, rather than some arbitrary int value.