vendredi 22 juin 2018

Simplifying the statement

Can anyone please help or suggest to simplify the following condition:

if (null == parentInstruction.getQuantity() || 
       (null != parentInstruction.getQuantity() && 
           (
           (parentInstruction.getQuantity().compareTo(BigDecimal.ZERO) == 0 && !canSkipTransTypeCds(parentInstruction)) || 
           (parentInstruction.getQuantity().compareTo(BigDecimal.ZERO) != 0)
           )
       )
   )  {
   return true;
}

Aucun commentaire:

Enregistrer un commentaire