我陷入了一个问题。我有以下方法:
public byte determineCardType(final IInput inputData) {
byte cardType = UNKNOWN_CARD;
try {
if (isWagRewardsLoyaltyCard(inputData))
cardType = WAG_LOYALTY_CARD_TYPE;
else if (isDRCard(inputData)) //checking that card scanned and swiped is a DR Card
cardType = DR_CARD_TYPE;
else if (isWagRewardsPartnerCard(inputData))
cardType = AARP_CARD_TYPE;
return cardType;
} catch (Exception e) {
return UNKNOWN_CARD;
}
}
}
然后,我有另一段代码,我在其中检查从上述方法返回的卡类型。
if((aarpCardSupport.isAARPCard(input))||(determineCardType(input)==DR_CARD_TYPE))
{
return true;
}else if((isDRCard(input))&&(isDRLoayltyEnabled())) //would return 1 for DR card only when isDRLoayltyEnabled returns true
{
return true;
}
return false ;
}
但是在上面的代码中,确定卡类型显示错误,因为它的返回类型是字节,我无法比较使用
if((aarpCardSupport.isAARPCard(input))||(determineCardType(input)==DR_CARD_TYPE)) ,
请指教。