vendredi 6 décembre 2019

opposite of if condition

I am trying to rewrite my if else statement so I skip the //do nothing part but I can't get my around to find the opposite of the if statement.

someone please help?!

if (decision.equals("repay")){                              
    String riskClass = null;
    if (doc.hasItem("riskclass")){
        riskClass = doc.getItemValueString("riskclass");
    }                                   

    if ( (null == riskClass) || (riskClass.equals("")) || (riskClass.equals("repay")) ){  
        //do nothing
    } else{                                 
        //do something
    }                               
}

Aucun commentaire:

Enregistrer un commentaire