Uso excesivo de afirmaciones If else

Tengo una consulta, es decir, he usado un método, pero hay muchas veces que he usado. Si no es así, no se ha vuelto muy ambiguo. Por favor, avise si puedo usar otro bucle condicional también ... más abajo está mi código.

 if (cardType == AARP_CARD_TYPE) {
      userResponse = messageBox.showMessage("CandidateAARPCardAttachCardToExistingTransaction",
          null, IMessageBox.YESNO); // MSG:31.59
      transaction.setValue(ITransactionHashtableWag.LOYALTY_MESSAGE_DISPLAYED,
          WalgreensRewardsConstants.ATTACH_CANDIDATE_AARP_CARD);
    } else if ((cardType == PSC_CARD_TYPE) && ((!PosHelper.isRunningAsService()))) {
      userResponse = messageBox.showMessage("PendingPSCCardAttachCardToExistingTransaction", null,
          IMessageBox.YESNO); // MSG:31.60
      transaction.setValue(ITransactionHashtableWag.LOYALTY_MESSAGE_DISPLAYED,
          WalgreensRewardsConstants.ATTACH_PENDING_PSC_CARD);

    } else if ((cardType == DR_CARD_TYPE) && ((!PosHelper.isRunningAsService()))) {
      userResponse = messageBox.showMessage("PendingDRCardAttachCardToExistingTransaction", null,
          IMessageBox.YESNO); // MSG:31.63
      transaction.setValue(ITransactionHashtableWag.LOYALTY_MESSAGE_DISPLAYED,
          WalgreensRewardsConstants.ATTACH_PENDING_DR_CARD);

    } else if ((cardType == WAG_LOYALTY_CARD_TYPE)){
                transaction.setValue(ITransactionHashtableWag.LOYALTY_MESSAGE_DISPLAYED,
                  WalgreensRewardsConstants.ATTACH_NOT_ON_FILE);

            if((!PosHelper.isRunningAsService())) {
      userResponse = messageBox.showMessage("CardNotOnFileToAttach", null, IMessageBox.YESNO); // MSG:31.32
      // BUC
      // 1.22.1
    }


    } else { // If the device is neither of these, POS displays Message 1
      // Button, MSG 31.14. [BUC
      // 1.23.2]
      displayMessage("InvalidLoyaltyCard");
      transaction.setValue(ITransactionHashtableWag.LOYALTY_MESSAGE_DISPLAYED,
          NOT_VALID_LOYALTY_CARD);
      userResponse = -1;
    }

Por favor, avise cómo puedo mejorar mi lógica anterior con algunas otras declaraciones condicionales, ya que hay un montón de lotes de If Else se usa ... !!

Respuestas a la pregunta(4)

Su respuesta a la pregunta