public static final int FALSE = 0;
public static final int TRUE = 10;
請告訴我一件事我有這個以下的關於一個條件的檢查
if (!walgreensRewardsSupport.isPreProdOrTrainingMode()
&& walgreensRewardsSupport.isWagRewardsRedeemptionEnabled()
&& null != walgreensRewardsInfoLine
&& null != walgreensRewardsInfoLine.getMemberFullProfile()
&& (null != walgreensRewardsInfoLine.getMemberFullProfile().getRewardPoints())
&& (walgreensRewardsInfoLine.getMemberFullProfile().getRewardPoints().getCurrentBalance() != 0)
&& !transaction
.getBooleanValue(ITransactionHashtableWag.REWARDS_REDEMPTION_ZIPCODE_LIMIT_REACHED)
&& !walgreensRewardsRedemptionSupport.isLoyaltyRedemptionTenderLineExist(transaction)
// No need to force recalculation each time, recalculation happens after any tender line is
// added to transaction.
&& walgreensRewardsRedemptionSupport.getRedemptionEligibleTransactionAmount(transaction,
true, false).isGreaterThanZero()) {
return TRUE;
}
else {
return FALSE;
}
}
一段代碼,現在我要在這之間加一個條件......檢查 walgreensRewardsInfoLine。 getMemberFullProfile()。getRewardPoints()的GetValues()。大小() 是0,那麼就返回False..I已經通過以下方式完成..
if (!walgreensRewardsSupport.isPreProdOrTrainingMode()
&& walgreensRewardsSupport.isWagRewardsRedeemptionEnabled()
&& null != walgreensRewardsInfoLine
&& null != walgreensRewardsInfoLine.getMemberFullProfile()
&& (null != walgreensRewardsInfoLine.getMemberFullProfile().getRewardPoints())
&& (walgreensRewardsInfoLine.getMemberFullProfile().getRewardPoints().getCurrentBalance() != 0)
&& !transaction
.getBooleanValue(ITransactionHashtableWag.REWARDS_REDEMPTION_ZIPCODE_LIMIT_REACHED)
&& !walgreensRewardsRedemptionSupport.isLoyaltyRedemptionTenderLineExist(transaction)
// No need to force recalculation each time, recalculation happens after any tender line is
// added to transaction.
&& walgreensRewardsRedemptionSupport.getRedemptionEligibleTransactionAmount(transaction,
true, false).isGreaterThanZero()) {
return TRUE;
}else if (walgreensRewardsInfoLine.getMemberFullProfile().getRewardPoints().getCurrentBalance() == 0)
{
return FALSE
}
else {
return FALSE;
}
}
請告知是心病RECT .. !!
1.發佈問題後,您不能期望答案少於120秒。 2.你有沒有測試過它是否按預期工作?如果沒有,你注意到了什麼意外的行爲? – assylias
什麼是真和假?如果他們只是真的和錯誤的,爲什麼不使用普通的Java文字?在那個和「null!= ...」之間,這看起來更像C而不是Java。 –
可能的重複用戶:http://stackoverflow.com/users/1370546/user1370546和http://stackoverflow.com/users/1188021/neera –