当前位置: 首页>>代码示例>>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;未经允许,请勿转载。