Example usage for org.apache.commons.lang StringUtils join

List of usage examples for org.apache.commons.lang StringUtils join

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils join.

Prototype

public static String join(Collection<?> collection, String separator) 

Source Link

Document

Joins the elements of the provided Collection into a single String containing the provided elements.

Usage

From source file:com.tibco.businessworks6.sonar.plugin.ProcessExtensions.java

@SuppressWarnings("rawtypes")
public static List getExtensions() {
    ImmutableList.Builder<Object> builder = ImmutableList.builder();
    builder.add(ProcessLanguage.class);
    builder.add(ProcessSonarWayProfile.class);
    builder.add(ProcessRuleDefinition.class);
    builder.add(ProcessRuleSensor.class);
    //builder.add(ProcessMetricSensor.class);
    builder.add(PropertyDefinition.builder(ProcessLanguage.FILE_SUFFIXES_KEY)
            .defaultValue(StringUtils.join(ProcessLanguage.DEFAULT_FILE_SUFFIXES, ","))
            .name("Process file suffixes").description("Comma-separated list of suffixes for files to analyze.")
            .category(BusinessWorksPlugin.TIBCO_BUSINESSWORK_CATEGORY).subCategory(SUB_CATEGORY_NAME)
            .onQualifiers(Qualifiers.PROJECT).build());
    return builder.build();
}

From source file:com.skymobi.monitor.util.FormatUtil.java

public String join(List list) {
    return StringUtils.join(list.toArray(), ",");
}

From source file:com.fengduo.bee.search.utils.PinyinParser.java

public static Set<String> converter2AllSpell(String chines) {
    if (StringUtils.isEmpty(chines)) {
        return Collections.<String>emptySet();
    }//from  w ww .  j av a  2s.co m
    StringBuffer pinyinName = new StringBuffer();
    char[] nameChar = chines.toCharArray();
    HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
    defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
    defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
    for (int i = 0; i < nameChar.length; i++) {
        if (nameChar[i] > 128) {
            try {
                // ??
                String[] strs = PinyinHelper.toHanyuPinyinStringArray(nameChar[i], defaultFormat);
                if (strs != null) {
                    pinyinName.append(StringUtils.join(strs, ","));
                }
            } catch (BadHanyuPinyinOutputFormatCombination e) {
                e.printStackTrace();
            }

        } else {
            pinyinName.append(nameChar[i]);
        }
        pinyinName.append(" ");
    }
    return parseTheChineseByObject(discountTheChinese(pinyinName.toString()));

}

From source file:com.appleframework.monitor.util.FormatUtil.java

public String join(List<?> list) {
    return StringUtils.join(list.toArray(), ",");
}

From source file:br.com.ingenieux.mojo.simpledb.CreateDomainsMojo.java

@Override
protected Object executeInternal() throws Exception {
    if (getLog().isInfoEnabled())
        getLog().info("Creating Domains: " + StringUtils.join(domainsCollection, ", "));

    for (String newDomainToCreate : domainsCollection) {
        if (getLog().isInfoEnabled())
            getLog().info(" * " + newDomainToCreate);

        getService().createDomain(new CreateDomainRequest(newDomainToCreate));
    }//from   w  w  w .  ja  v  a2s  . c  om

    return getService().listDomains().getDomainNames();
}

From source file:br.com.ingenieux.mojo.simpledb.DeleteDomainsMojo.java

@Override
protected void configure() {
    if ("*".equals(this.domains))
        this.domains = StringUtils.join(getService().listDomains().getDomainNames(), ",");

    super.configure();
}

From source file:com.ms.scombiz.solr.utils.BaseSolrQueryConvert.java

protected static SolrQuery setQuery(List<String> params, SearchQuery searchQuery) {
    SolrQuery solrQuery = new SolrQuery();
    String query = null;/* w w  w.j a  v a2 s. c o  m*/
    if (params.isEmpty()) {
        query = ("*:*");
    } else {
        query = StringUtils.join(params, " AND ");
    }
    solrQuery.setQuery(query);
    solrQuery.setStart(searchQuery.getStart());
    solrQuery.setRows(searchQuery.getRows());
    if (StringUtils.isNotBlank(searchQuery.getSortFiled())) {
        solrQuery.addSort(searchQuery.getSortFiled(), searchQuery.getOrderBy());
    }
    return solrQuery;
}

From source file:de.tudarmstadt.ukp.dkpro.tc.core.util.SaveModelUtils.java

public static void writeFeatureInformation(File outputFolder, List<String> featureSet) throws Exception {
    String featureExtractorString = StringUtils.join(featureSet, "\n");
    FileUtils.writeStringToFile(new File(outputFolder, MODEL_FEATURE_EXTRACTORS), featureExtractorString);
}

From source file:com.haulmont.cuba.gui.components.filter.condition.FilterConditionUtils.java

public static String getPropertyLocCaption(MetaClass metaClass, String propertyPath) {
    MessageTools messageTools = AppBeans.get(MessageTools.class);
    MetaPropertyPath mpp = metaClass.getPropertyPath(propertyPath);
    if (mpp == null) {
        return propertyPath;
    } else {/*w  w w.ja  v  a2s . c o m*/
        MetaProperty[] metaProperties = mpp.getMetaProperties();
        StringBuilder sb = new StringBuilder();

        List<String> metaPropertyNames = new ArrayList<>();

        for (int i = 0; i < metaProperties.length; i++) {
            metaPropertyNames.add(metaProperties[i].getName());

            String currentMetaPropertyPath = StringUtils.join(metaPropertyNames, ".");

            sb.append(messageTools.getPropertyCaption(metaClass, currentMetaPropertyPath));
            if (i < metaProperties.length - 1) {
                sb.append(".");
            }
        }
        return sb.toString();
    }
}

From source file:energy.usef.core.workflow.util.WorkflowUtil.java

/**
 * Validate the context based on all Enum values.
 * /*  ww w. ja  v  a 2  s. co m*/
 * @param name - The name of the Workflow Step we are currently in.
 * @param context - The {@link WorkflowContext} to validate.
 * @param values - The required enum keys.
 */
public static void validateContext(String name, WorkflowContext context,
        @SuppressWarnings("rawtypes") Enum[] values) {
    List<String> nullProperties = new ArrayList<>();
    for (@SuppressWarnings("rawtypes")
    Enum value : values) {
        String requiredProperty = value.name();
        if (context.getValue(requiredProperty) == null) {
            nullProperties.add(requiredProperty);
        }
    }
    if (!nullProperties.isEmpty()) {
        StringBuilder message = new StringBuilder("WorkflowContext validation failed for ");
        message.append(name);
        message.append(System.lineSeparator());
        message.append("The following propeties are missing: ");
        message.append(StringUtils.join(nullProperties, ", "));
        throw new WorkflowException(message.toString());
    }
}