Example usage for com.liferay.portal.kernel.util StringUtil add

List of usage examples for com.liferay.portal.kernel.util StringUtil add

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util StringUtil add.

Prototype

public static String add(String s, String add, String delimiter, boolean allowDuplicates) 

Source Link

Document

Adds string add to string s that represents a delimited list of strings, using a specified delimiter and optionally allowing duplicate words.

Usage

From source file:au.com.permeance.liferay.portlet.util.StringUtilHelper.java

License:Open Source License

public static String addArrayItems(String str, String[] items, String delimiter, boolean allowDuplicates) {

    String result = str;/* w ww .ja va  2s.  co m*/

    if (items != null) {
        for (String item : items) {
            result = StringUtil.add(result, item, delimiter, allowDuplicates);
        }
    }

    return result;
}

From source file:com.liferay.portlet.shopping.model.impl.ShoppingCartImpl.java

License:Open Source License

public void addItemId(long itemId, String fields) {
    setItemIds(StringUtil.add(getItemIds(), itemId + fields, StringPool.COMMA, true));
}