当前位置: 首页>>代码示例>>Java>>正文


Java StringUtils.upperCase方法代码示例

本文整理汇总了Java中org.apache.commons.lang3.StringUtils.upperCase方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.upperCase方法的具体用法?Java StringUtils.upperCase怎么用?Java StringUtils.upperCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang3.StringUtils的用法示例。


在下文中一共展示了StringUtils.upperCase方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSearchableTextOld

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static String getSearchableTextOld(String... strings) {
    Set<String> allUppercaseSubstrings = new LinkedHashSet<>();

    for (String sourceString : strings) {
        String string = StringUtils.upperCase(StringUtils.trimToNull(sourceString));
        if (string != null) {

            // Firstly get all substrings including spaces so we get search term match as it is typed
            allUppercaseSubstrings.addAll(getAllSubstrings(string));

            // Now do the same per word so you can search for surname only for example
            for (String word : SPACE_SEPARATOR_PATTERN.split(string)) {
                Set<String> upperCaseSubstrings = getAllSubstrings(word.toUpperCase());
                allUppercaseSubstrings.addAll(upperCaseSubstrings);
            }
        }
    }
    return Joiner.on(" ").join(allUppercaseSubstrings);
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:20,代码来源:TextSearch.java

示例2: transformCase

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
 * @param description
 * @return
 */
private static String transformCase(String description, Options options) {
    String descTemp = description;
    switch (options.getCasingType()) {
        case Sentence:
            descTemp = StringUtils.upperCase("" + descTemp.charAt(0)) + descTemp.substring(1);
            break;
        case Title:
            descTemp = StringUtils.capitalize(descTemp);
            break;
        default:
            descTemp = descTemp.toLowerCase();
            break;
    }
    return descTemp;
}
 
开发者ID:quanticc,项目名称:sentry,代码行数:20,代码来源:CronExpressionDescriptor.java

示例3: getSearchableText

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
 * Generates all substring permutations of one or more input strings, intended to be used as a search index to facilitate partial string searching.
 * See unit test and/or monash-thesis-submission Submission.getSearchableText() and SubmissionRepository.search() for an example of how this is used and searched on
 *
 * NOTE: To allow searches to firstly match on partial or full term including spaces the first thing we do is take the whole string and all permutations down from it. Then we do words.
 *
 */
public static String getSearchableText(String... strings) {
    Set<String> allUppercaseSubstrings = new LinkedHashSet<>();

    for (String sourceString : strings) {
        String string = StringUtils.upperCase(StringUtils.trimToNull(sourceString));
        if (string != null) {

            // Firstly get all substrings including spaces so we get search term match as it is typed
            allUppercaseSubstrings.addAll(getAllSubstrings(string));

            // Now do the same per word so you can search for surname only for example
            for (String word : SPACE_SEPARATOR_PATTERN.split(string)) {
                Set<String> upperCaseSubstrings = getAllSubstrings(word.toUpperCase());
                allUppercaseSubstrings.addAll(upperCaseSubstrings);
            }
        }
    }
    return Joiner.on(" ").join(allUppercaseSubstrings);
}
 
开发者ID:lorderikir,项目名称:googlecloud-techtalk,代码行数:27,代码来源:TextSearch.java

示例4: httpRequest

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
private static String httpRequest(String url, Object data, String method, int timeoutMilliseconds/*毫秒*/, int retryTimes) {
    Preconditions.checkArgument(retryTimes <= 10 && retryTimes >= 0, "retryTimes should between 0(include) and 10(include)");
    method = StringUtils.upperCase(method);
    Preconditions.checkArgument(HttpMethod.resolve(method) != null, "http request method error");
    try {
        HttpRequest request = getHttpRequest(url, data, method);
        long start = System.currentTimeMillis();
        String uuid = StringUtils.left(UUID.randomUUID().toString(), 13);
        logger.info("UUID:{}, Request URL:{} , method:{}, Request data:{}", uuid, url, method, JsonUtil.writeValueQuite(data));
        request.setNumberOfRetries(retryTimes);
        request.setConnectTimeout(timeoutMilliseconds);
        request.setLoggingEnabled(LOGGING_ENABLED);
        HttpResponse response = request.execute();
        response.setLoggingEnabled(LOGGING_ENABLED);
        InputStream in = new BufferedInputStream(response.getContent());
        String res = StreamUtils.copyToString(in, Charsets.UTF_8);
        logger.info("UUID:{}, Request cost [{}ms], Response data:{}", uuid, (System.currentTimeMillis() - start), res);
        return res;
    } catch (IOException e) {
        logger.warn("Http request error", e);
    }
    return StringUtils.EMPTY;
}
 
开发者ID:slking1987,项目名称:mafia,代码行数:24,代码来源:HttpUtil.java

示例5: getSearchableText

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
 * Generates all substring permutations of one or more input strings, intended to be used as a search index to facilitate partial string searching.
 * See unit test and/or monash-thesis-submission Submission.getSearchableText() and SubmissionRepository.search() for an example of how this is used and searched on
 *
 * NOTE: To allow searches to firstly match on partial or full term including spaces the first thing we do is take the whole string and all permutations down from it. Then we do words.
 *
 */
public static String getSearchableText(String... strings) {
    Set<String> allUppercaseSubstrings = new LinkedHashSet<>();

    for (String sourceString : strings) {
        String string = StringUtils.upperCase(StringUtils.trimToNull(sourceString));
        if (string != null) {
            allUppercaseSubstrings.addAll(getAllSubstrings(string));
        }
    }
    return Joiner.on(" ").join(allUppercaseSubstrings);
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:19,代码来源:TextSearch.java

示例6: populateAlphas

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
private static PostDTO populateAlphas(Post post, Boolean isAlphabetic) {
    PostDTO built = new PostDTO();
    String postTitle = post.getPostTitle();
    String alphaKey = StringUtils.upperCase(substring(postTitle, 0, 1));
    if (!isAlphabetic) {
        alphaKey = ALPHACODE_09;
    }

    built.postTitle = postTitle;
    built.postName = post.getPostName();
    built.alphaKey = alphaKey;
    return built;
}
 
开发者ID:mintster,项目名称:nixmash-blog,代码行数:14,代码来源:PostDTO.java

示例7: handleSingleStr

import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
protected String handleSingleStr(String input) {
    return StringUtils.upperCase(input);
}
 
开发者ID:virjar,项目名称:vscrawler,代码行数:5,代码来源:UpperCase.java


注:本文中的org.apache.commons.lang3.StringUtils.upperCase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。