I tend to add isXXX()
methods to my enums:
enum Constants {
ONE,TWO,THREE;
public boolean isOne() { return this == ONE; }
public boolean isTwo() { return this == TWO; }
public boolean isThree() { return this == THREE; }
}
Then, if value
is an instance of your enum, you can use th:if="${value.one}"
.