當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。