Is there a better and more efficient way to do this:
I am inputting 2 values then checking them of on a list, as if current = three then it returns true for checking for one, two and three
NOTE: these values (one, two, three) are just placeholders for the example in my use there is no relation between them except that they have a different priority.
enum Foo {
ONE(1), TWO(2), THREE(3)
private final int priority;
public Foo(int priority) {this.priority = priority;}
public int getPriority() {return priority;}
}
public boolean checker(Foo current, Foo check) {
if (check == ONE) {
if (current == ONE || current == TWO
|| current == THREE) {
return true;
}
}
if (check == TWO) {
if (current == TWO || current == THREE) {
return true;
}
}
if (check == THREE) {
if (current == THREE) {
return true;
}
}
return false;
}