Example usage for org.apache.commons.lang3 StringUtils lowerCase

List of usage examples for org.apache.commons.lang3 StringUtils lowerCase

Introduction

In this page you can find the example usage for org.apache.commons.lang3 StringUtils lowerCase.

Prototype

public static String lowerCase(final String str) 

Source Link

Document

Converts a String to lower case as per String#toLowerCase() .

A null input String returns null .

 StringUtils.lowerCase(null)  = null StringUtils.lowerCase("")    = "" StringUtils.lowerCase("aBc") = "abc" 

Note: As described in the documentation for String#toLowerCase() , the result of this method is affected by the current locale.

Usage

From source file:com.xpn.xwiki.plugin.lucene.DocumentData.java

/**
 * @return a string containing the result of {@link AbstractIndexData#getFullText} plus the full text content of
 *         this document (in the given language)
 *//* w  ww  .  j  av  a  2s . co  m*/
@Override
protected void getFullText(StringBuilder sb, XWikiDocument doc, XWikiContext context) {
    super.getFullText(sb, doc, context);

    sb.append(" ");
    sb.append(StringUtils.lowerCase(doc.getContent()));
    sb.append(" ");

    getObjectFullText(sb, doc, context);
}

From source file:com.eryansky.common.orm.core.PageRequest.java

/**
 * ???./*from w ww  . j  ava 2 s .  c om*/
 *
 * @param orderDir ?descasc,?','.
 */
public void setOrderDir(final String orderDir) {
    String lowcaseOrderDir = StringUtils.lowerCase(orderDir);

    //order?
    String[] orderDirs = StringUtils.split(lowcaseOrderDir, ',');

    if (ArrayUtils.isEmpty(orderDirs)) {
        return;
    }

    for (String orderDirStr : orderDirs) {
        if (!StringUtils.equals(Sort.DESC, orderDirStr) && !StringUtils.equals(Sort.ASC, orderDirStr)) {
            throw new IllegalArgumentException("??" + orderDirStr + "??");
        }
    }

    this.orderDir = lowcaseOrderDir;
}

From source file:info.magnolia.security.setup.AddDuplicateAndMoveActionsToSecurityAppTask.java

@Override
public void execute(InstallContext installContext) throws TaskExecutionException {
    for (String subAppName : names.keySet()) {
        String subAppUnitName = names.get(subAppName);

        String moveActionName = String.format("move%s", subAppUnitName);
        String duplicateActionName = String.format("duplicate%s", subAppUnitName);

        String subAppPath = String.format("/security/subApps/%s/", subAppName);
        String actionPath = subAppPath + "actions/";

        String moveActionPath = actionPath + moveActionName;
        String duplicateActionPath = actionPath + duplicateActionName;

        new PartialBootstrapTask("", "",
                "/mgnl-bootstrap/security-app/config.modules.security-app.apps.security.xml", moveActionPath)
                        .execute(installContext);
        new PartialBootstrapTask("", "",
                "/mgnl-bootstrap/security-app/config.modules.security-app.apps.security.xml",
                duplicateActionPath).execute(installContext);

        String actionbarPath = String.format("%sactionbar/sections/%s/groups/editActions/items/", subAppPath,
                StringUtils.lowerCase(subAppUnitName));
        String moveActionBarEntry = actionbarPath + moveActionName;
        String duplicateActionBarEntry = actionbarPath + duplicateActionName;

        new PartialBootstrapTask("", "",
                "/mgnl-bootstrap/security-app/config.modules.security-app.apps.security.xml",
                moveActionBarEntry).execute(installContext);
        new PartialBootstrapTask("", "",
                "/mgnl-bootstrap/security-app/config.modules.security-app.apps.security.xml",
                duplicateActionBarEntry).execute(installContext);
    }//from  w  ww .  j av  a2  s.  c o  m
}

From source file:com.thinkmore.framework.orm.Page.java

/**
 * ???./*ww w .  ja va 2 s  . co  m*/
 * 
 * @param order
 *            ?descasc,?','.
 */
public void setOrder(final String order) {
    // order?
    String[] orders = StringUtils.split(StringUtils.lowerCase(order), ',');
    for (String orderStr : orders) {
        if (!StringUtils.equals(DESC, orderStr) && !StringUtils.equals(ASC, orderStr)) {
            throw new IllegalArgumentException("??" + orderStr + "??");
        }
    }
    this.order = StringUtils.lowerCase(order);
}

From source file:net.eledge.android.europeana.search.SearchController.java

public void suggestions(TaskListener<Item[]> listener, String query) {
    if (mSuggestionTask != null) {
        mSuggestionTask.cancel(true);//from  ww  w . j  a va  2s . c om
    }
    query = StringUtils.lowerCase(StringUtils.trim(query));
    if (suggestionCache.containsKey(query)) {
        listener.onTaskFinished(suggestionCache.get(query));
    } else {
        mSuggestionTask = new SuggestionTask(listener);
        mSuggestionTask.execute(query);
    }
}

From source file:com.piesky.core.orm.Page.java

/**
 * ???./*w  ww.  ja va2 s  .  c o  m*/
 * 
 * @param order
 *            ?descasc,?','.
 */
public void setOrder(final String order) {
    String lowcaseOrder = StringUtils.lowerCase(order);

    // order?
    String[] orders = StringUtils.split(lowcaseOrder, ',');
    for (String orderStr : orders) {
        if (!StringUtils.equals(DESC, orderStr) && !StringUtils.equals(ASC, orderStr)) {
            throw new IllegalArgumentException("??" + orderStr + "??");
        }
    }

    this.order = lowcaseOrder;
}

From source file:cn.com.infcn.ade.common.persistence.Page.java

/**
 * ???.// www  .j  av  a2s.c  o m
 * 
 * @param order ?descasc,?','.
 */
public void setOrder(final String order) {
    String lowcaseOrder = StringUtils.lowerCase(order);

    //order?
    String[] orders = StringUtils.split(lowcaseOrder, ',');
    for (String orderStr : orders) {
        if (!StringUtils.equals(DESC, orderStr) && !StringUtils.equals(ASC, orderStr)) {
            throw new IllegalArgumentException("??" + orderStr + "??");
        }
    }

    this.order = lowcaseOrder;
}

From source file:com.ottogroup.bi.spqr.pipeline.MicroPipelineManager.java

/**
 * Initializes the micro pipeline manager
 * @param processingNodeId identifier of node this manager lives on
 * @param componentRepository reference to {@link ComponentRepository} which provides access to all {@link MicroPipelineComponent}
 * @param maxNumberOfThreads max. number of threads assigned to {@link ExecutorService} (1 = single threaded, n = fixed number of threads, other = cached thread pool)
 * @throws RequiredInputMissingException   
 */// w ww .  java2s. c om
public MicroPipelineManager(final String processingNodeId, final ComponentRepository componentRepository,
        final int maxNumberOfThreads) throws RequiredInputMissingException {

    //////////////////////////////////////////////////////////////////////////////
    // validate provided input
    if (componentRepository == null)
        throw new RequiredInputMissingException("Missing required component repository");
    if (StringUtils.isBlank(processingNodeId))
        throw new RequiredInputMissingException("Missing required processing node identifier");
    //
    //////////////////////////////////////////////////////////////////////////////

    this.processingNodeId = StringUtils.lowerCase(StringUtils.trim(processingNodeId));
    this.microPipelineFactory = new MicroPipelineFactory(this.processingNodeId, componentRepository);

    if (maxNumberOfThreads == 1)
        this.executorService = Executors.newSingleThreadExecutor();
    else if (maxNumberOfThreads > 1)
        this.executorService = Executors.newFixedThreadPool(maxNumberOfThreads);
    else
        this.executorService = Executors.newCachedThreadPool();

}

From source file:com.ottogroup.bi.asap.operator.json.aggregator.JsonContentAggregatorResult.java

/**
 * Adds the aggregated value for a given field value to the map holding all aggregation values for that specific field. Example: (field='cs-host', fieldValue='www.otto.de', aggregationValue=5)
 * @param field/*from   w  w w. j a  va2 s.com*/
 * @param fieldValue
 * @param aggregationValue
 * @throws RequiredInputMissingException
 */
public void addAggregatedValue(final String field, final String fieldValue, final long aggregationValue)
        throws RequiredInputMissingException {

    ///////////////////////////////////////////////////////////////////////////////////////////
    // validate provided input
    if (StringUtils.isBlank(field))
        throw new RequiredInputMissingException("Missing required input for parameter 'field'");
    if (StringUtils.isBlank(fieldValue))
        throw new RequiredInputMissingException("Missing required input for parameter 'fieldValue'");
    //
    ///////////////////////////////////////////////////////////////////////////////////////////

    String fieldKey = StringUtils.lowerCase(StringUtils.trim(field));
    Map<String, Long> fieldAggregationValues = this.aggregatedValues.get(fieldKey);
    if (fieldAggregationValues == null)
        fieldAggregationValues = new HashMap<>();
    fieldAggregationValues.put(fieldValue, aggregationValue);
    this.aggregatedValues.put(fieldKey, fieldAggregationValues);
}

From source file:com.hesine.manager.generate.Generate.java

public static void execute(File curProjectPath) {
    // ==========  ?? ====================

    // ??????/* w  ww  .j av  a 2  s . c om*/
    // ?{packageName}/{moduleName}/{dao,entity,service,web}/{subModuleName}/{className}

    // packageName ????applicationContext.xmlsrping-mvc.xml?base-package?packagesToScan?4?
    String packageName = "com.hesine.manager";

    //      String moduleName = "function";         // ???sys
    String moduleName = ""; // ???sys
    String tableName = "tb_product"; // ???sys
    String subModuleName = ""; // ?????
    String className = "product"; // ??product
    String classAuthor = "Jason"; // ThinkGem
    String functionName = "?"; // ??
    List<Map<String, String>> fileds = new ArrayList<Map<String, String>>();
    // map
    Map<String, String> dataName = new HashMap<String, String>();
    dataName.put("dataType", "String");
    dataName.put("name", "name");
    dataName.put("methodName", "Name");
    dataName.put("comment", "??");
    dataName.put("dbName", "name");

    Map<String, String> dataDesc = new HashMap<String, String>();
    dataDesc.put("dataType", "String");
    dataDesc.put("name", "description");
    dataDesc.put("methodName", "Description");
    dataDesc.put("comment", "??");
    dataDesc.put("dbName", "description");

    fileds.add(dataName);
    fileds.add(dataDesc);

    // ???
    Boolean isEnable = true;

    // ==========  ?? ====================

    if (!isEnable) {
        logger.error("????isEnable = true");
        return;
    }

    //        StringUtils.isBlank(moduleName) ||
    if (StringUtils.isBlank(packageName) || StringUtils.isBlank(className)
            || StringUtils.isBlank(functionName)) {
        logger.error("??????????????");
        return;
    }

    // ?
    String separator = File.separator;

    // ?
    File projectPath = curProjectPath;
    while (!new File(projectPath.getPath() + separator + "src" + separator + "main").exists()) {
        projectPath = projectPath.getParentFile();
    }
    logger.info("Project Path: {}", projectPath);

    // ?
    String tplPath = StringUtils.replace(projectPath + "/src/main/java/com/hesine/manager/generate/template",
            "/", separator);
    logger.info("Template Path: {}", tplPath);

    // Java
    String javaPath = StringUtils.replaceEach(
            projectPath + "/src/main/java/" + StringUtils.lowerCase(packageName), new String[] { "/", "." },
            new String[] { separator, separator });
    logger.info("Java Path: {}", javaPath);

    // Xml
    String xmlPath = StringUtils.replace(projectPath + "/src/main/resources/mybatis", "/", separator);
    logger.info("Xml Path: {}", xmlPath);

    // 
    String viewPath = StringUtils.replace(projectPath + "/src/main/webapp/WEB-INF/views", "/", separator);
    logger.info("View Path: {}", viewPath);

    // ???
    Map<String, Object> model = Maps.newHashMap();
    model.put("packageName", StringUtils.lowerCase(packageName));
    model.put("moduleName", StringUtils.lowerCase(moduleName));
    model.put("subModuleName",
            StringUtils.isNotBlank(subModuleName) ? "." + StringUtils.lowerCase(subModuleName) : "");
    model.put("className", StringUtils.uncapitalize(className));
    model.put("ClassName", StringUtils.capitalize(className));
    model.put("classAuthor", StringUtils.isNotBlank(classAuthor) ? classAuthor : "Generate Tools");
    model.put("classVersion", DateUtils.getDate());
    model.put("functionName", functionName);
    //      model.put("tableName", model.get("moduleName")+(StringUtils.isNotBlank(subModuleName)
    //            ?"_"+StringUtils.lowerCase(subModuleName):"")+"_"+model.get("className"));
    model.put("tableName", tableName);

    model.put("urlPrefix",
            model.get("moduleName")
                    + (StringUtils.isNotBlank(subModuleName) ? "/" + StringUtils.lowerCase(subModuleName) : "")
                    + "/" + model.get("className"));
    model.put("viewPrefix", //StringUtils.substringAfterLast(model.get("packageName"),".")+"/"+
            model.get("urlPrefix"));
    model.put("permissionPrefix",
            model.get("moduleName")
                    + (StringUtils.isNotBlank(subModuleName) ? ":" + StringUtils.lowerCase(subModuleName) : "")
                    + ":" + model.get("className"));
    model.put("fileds", fileds);

    //        // ? Entity
    //        FileGenUtils.generateEntity(tplPath, javaPath, model);
    //
    //        // ? sqlMap
    //        FileGenUtils.generateSqlMap(tplPath, xmlPath, model);
    //
    //        // ? Model
    //        FileGenUtils.generateModel(tplPath, javaPath, model);
    //
    //        // ? Dao
    //        FileGenUtils.generateDao(tplPath, javaPath, model);
    //
    //        // ? Service
    //        FileGenUtils.generateService(tplPath, javaPath, model);
    //
    //        // ? ServiceImpl
    //        FileGenUtils.generateServiceImpl(tplPath, javaPath, model);
    //
    //        // ? Controller
    //        FileGenUtils.generateController(tplPath, javaPath, model);

    // ? add.ftl
    FileGenUtils.generateAddFtl(tplPath, viewPath, model);

    // ? edit.ftl
    FileGenUtils.generateEditFtl(tplPath, viewPath, model);

    // ? list.ftl
    FileGenUtils.generateListFtl(tplPath, viewPath, model);

    logger.info("Generate Success.");
}