I would like to implement a Method with a input, which can be "A", "B" or "C". I know how to implement this with a String check, but I don't think its as clean as I need it to be. Is there any way doing this better (With an enum or something like that)?
Example:
private final options = {"A", "B", "C"};
private option;
public void setOption(option o){
if(this.options.contains(o)){
this.option = o;
} else {
this.option = null;
}
}