I have below block of code
if(Objects.nonNull(isMine)) {
if (isMine) {
this.books= // gets it from the database;
} else {
this. books= // gets it from the database
}
} else {
this. books = // gets it from the database
}
isMine - is a Boolean object I tried with switch case by converting isMine to a string as below
String.valueOf(isMine)
But didn't work .Suggest a better and faster way to implement above code in java.