第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

在java中檢查多個(gè)布爾條件

在java中檢查多個(gè)布爾條件

溫溫醬 2021-07-27 13:49:19
我有一個(gè)場(chǎng)景,我必須檢查模板是否已經(jīng)存在于數(shù)據(jù)庫(kù)中。如果存在,我必須根據(jù)現(xiàn)有模板返回一條消息。我有幾個(gè)模板:電子郵件、信件、短信。如果它們都存在,我必須返回“所有模板都已經(jīng)存在”。如果只有電子郵件模板存在,我必須返回只有電子郵件模板存在,信函和短信模板也是如此。代碼:for (EventVO eventVO: eventModuleList) {    List <EmailTemplateMaster> emailTemplateList = communicationDAO        .checkEmailTemplateExist(eventVO.getEventCode());    if (CollectionUtils.isNotEmpty(emailTemplateList)) {        emailTemplateExist = true;    }    List <LetterTemplateMaster> letterTemplateList = communicationDAO        .checkLetterTemplateExist(eventVO.getEventCode());    if (CollectionUtils.isNotEmpty(letterTemplateList)) {        letterTemplateExist = true;    }    List <SmsTemplateMaster> smsTemplateList = communicationDAO        .checkSmsTemplateExist(eventVO.getEventCode());    if (CollectionUtils.isNotEmpty(smsTemplateList)) {        smsTemplateExist = true;    }    if (emailTemplateExist && letterTemplateExist && smsTemplateExist) {        templateExist = CommunicationConstants.ALL_TEMPLATE_EXIST;    }    if (emailTemplateExist || !letterTemplateExist && !smsTemplateExist) {        templateExist = CommunicationConstants.EMAIL_TEMPLATE_EXIST;    }    if (!emailTemplateExist && letterTemplateExist && !smsTemplateExist) {        templateExist = CommunicationConstants.LETTER_TEMPLATE_EXIST;    }    if (!emailTemplateExist && !letterTemplateExist && smsTemplateExist) {        templateExist = CommunicationConstants.SMS_TEMPLATE_EXIST;    }}我可以知道檢查退出模板布爾值的最簡(jiǎn)單方法是否存在?;谕顺?,我必須發(fā)送相應(yīng)的消息。public static final String ALL_TEMPLATE_EXIST = "Email, Letter and Sms Template already exist for the selected event."; public static final String EMAIL_TEMPLATE_EXIST = "Email Template already exist for the selected event.";public static final String SMS_TEMPLATE_EXIST = "Sms Template already exist for the selected event.";public static final String LETTER_TEMPLATE_EXIST = "Email Letter Template already exist for the selected event.";
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 322 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)