當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils.isAnyBlank方法代碼示例

本文整理匯總了Java中org.apache.commons.lang3.StringUtils.isAnyBlank方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.isAnyBlank方法的具體用法?Java StringUtils.isAnyBlank怎麽用?Java StringUtils.isAnyBlank使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.lang3.StringUtils的用法示例。


在下文中一共展示了StringUtils.isAnyBlank方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: authGet

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
@GetMapping(produces = "text/plain;charset=utf-8")
public String authGet(
        @RequestParam(name = "signature", required = false) String signature,
        @RequestParam(name = "timestamp", required = false) String timestamp,
        @RequestParam(name = "nonce", required = false) String nonce,
        @RequestParam(name = "echostr", required = false) String echostr) {

    this.logger.info("\n接收到來自微信服務器的認證消息:[{}, {}, {}, {}]", signature,
            timestamp, nonce, echostr);

    if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) {
        throw new IllegalArgumentException("請求參數非法,請核實!");
    }

    if (this.wxService.checkSignature(timestamp, nonce, signature)) {
        return echostr;
    }

    return "非法請求";
}
 
開發者ID:xjtushilei,項目名稱:knowledge-forest-dialogue-recommendation,代碼行數:21,代碼來源:WechatController.java

示例2: Homeserver

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public Homeserver(HomeserverState state) {
    if (StringUtils.isAnyBlank(state.getAppName(), state.getAppVersion())) {
        throw new IllegalArgumentException("Application name and version must be set");
    }

    this.state = state;

    log.info("Homeserver is {}/{}", state.getAppName(), state.getAppVersion());
}
 
開發者ID:kamax-io,項目名稱:mxhsd,代碼行數:10,代碼來源:Homeserver.java

示例3: resetCorrectOffsets

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
/**
 * 按上次記錄重置offsets
 */
private void resetCorrectOffsets() {
    String kafkaServers = consumerContext.getProperties().getProperty("bootstrap.servers");
    String zkServers = consumerContext.getProperties().getProperty("zookeeper.connect");
    if (StringUtils.isAnyBlank(kafkaServers, zkServers)) {
        logger.warn(
            "resetCorrectOffsets exit。Please check [bootstrap.servers] and [zookeeper.connect] is existing");
        return;
    }
    ZkConsumerCommand command = new ZkConsumerCommand(zkServers, kafkaServers);
    try {
        List<String> topics = command.getSubscribeTopics(consumerContext.getGroupId());
        for (String topic : topics) {
            List<TopicPartitionInfo> partitions = command
                .getTopicOffsets(consumerContext.getGroupId(), topic);
            for (TopicPartitionInfo partition : partitions) {
                //期望的偏移
                long expectOffsets = consumerContext.getLatestProcessedOffsets(topic,
                    partition.getPartition());
                //
                if (expectOffsets >= 0 && expectOffsets < partition.getOffset()) {
                    command.resetTopicOffsets(consumerContext.getGroupId(), topic,
                        partition.getPartition(), expectOffsets);
                    logger.info("seek Topic[{}] partition[{}] from {} to {}", topic,
                        partition.getPartition(), partition.getOffset(), expectOffsets);
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    command.close();
}
 
開發者ID:warlock-china,項目名稱:azeroth,代碼行數:36,代碼來源:OldApiTopicConsumer.java

示例4: login

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
@Override
public User login(String name, String password) throws ServiceException {
    if (StringUtils.isAnyBlank(name, password)) {
        throw new ServiceException("用戶名或密碼不能為空!");
    }
    User user = userDao.findByName(name);
    if (StringUtils.equals(user.getPassword(), password)) {
        return user;
    }
    throw new ServiceException("用戶名或密碼錯誤,登錄失敗");
}
 
開發者ID:Xlongshu,項目名稱:EasyController,代碼行數:12,代碼來源:UserServiceImpl.java

示例5: add

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public synchronized static void add(String key, String value) {
    if (StringUtils.isAnyBlank(key, value)) { return; }
    allProperties.put(key, value);
}
 
開發者ID:warlock-china,項目名稱:azeroth,代碼行數:5,代碼來源:ResourceUtils.java

示例6: validateCaptcha

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
/**
 * 驗證驗證碼
 *
 * @param paraName 驗證碼參數
 */
public boolean validateCaptcha(String paraName) {
    String captcha = request.getParameter(paraName);
    String captchaKey = KaptchaExtend.getCaptcha(request);
    logger.debug("captcha:{}, captchaKey:{}", captcha, captchaKey);

    if (StringUtils.isAnyBlank(captcha, captchaKey)) {
        return false;
    }
    if (StringUtils.equalsIgnoreCase(captcha, captchaKey)) {
        KaptchaExtend.removeCaptcha(request.getSession());
        return true;
    }
    return false;
}
 
開發者ID:Xlongshu,項目名稱:EasyController,代碼行數:20,代碼來源:Controller.java


注:本文中的org.apache.commons.lang3.StringUtils.isAnyBlank方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。