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.marvelution.jira.plugins.hudson.streams.HudsonStreamsCommentHandler.java

/**
 * {@inheritDoc}/*from   w ww.  j a v a 2s.  co m*/
 */
@Override
public Either<PostReplyError, URI> postReply(Iterable<String> itemPath, String comment) {
    logger.debug("Accessing postReply for " + StringUtils.join(itemPath.iterator(), ", "));
    return null;
}

From source file:io.viewserver.operators.table.TableKey.java

@Override
public String toString() {

    List<String> result = new ArrayList<String>();
    for (Object obj : keyValues) {
        result.add(printParam(obj));/*from ww w  .j a  v a2 s .  c  o m*/
    }
    return StringUtils.join(keyValues, ",");
}

From source file:au.org.ala.delta.delfor.DirectivesUtils.java

public static boolean containsByName(AbstractDirective<?> directive, List<Directive> allDirectives) {
    String name = StringUtils.join(directive.getControlWords(), " ").toUpperCase();
    return containsName(name, allDirectives);
}

From source file:au.org.ala.delta.intkey.model.FormattingUtils.java

/**
 * Formats the values set for an integer character as a string. It is
 * assumed the values for the integer character have already been processed
 * such that they are in the range minimumValue - 1 to maximumValue + 1.
 * //from  w  ww  .ja v  a2 s .com
 * @param integerValues
 *            the values set for the integer character
 * @param minimumValue
 *            the character's minimum value
 * @param maximumValue
 *            the character's maximum value
 * @return the integer character's values formatted as a string.
 */
public static String formatIntegerValuesAsString(Set<Integer> integerValues, int minimumValue,
        int maximumValue) {
    Set<Integer> valuesCopy = new HashSet<Integer>(integerValues);

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

    if (integerValues.contains(minimumValue - 1)) {
        stringParts.add(Integer.toString(minimumValue - 1));
    }

    valuesCopy.remove(minimumValue - 1);
    valuesCopy.remove(maximumValue + 1);

    if (!valuesCopy.isEmpty()) {
        List<Integer> valuesCopyAsList = new ArrayList<Integer>(valuesCopy);
        Collections.sort(valuesCopyAsList);
        stringParts.add(Utils.formatIntegersAsListOfRanges(valuesCopyAsList, "/", "-"));
    }

    if (integerValues.contains(maximumValue + 1)) {
        stringParts.add(Integer.toString(maximumValue + 1));
    }

    return StringUtils.join(stringParts, "/");
}

From source file:cn.hxh.springside.mapper.CollectionMapper.java

/**
 * ????(Getter), ??.//from  w w  w  . j  a  v  a  2 s  . c  o m
 * 
 * @param collection ???.
 * @param propertyName ??????.
 * @param separator .
 */
public static String extractToString(final Collection collection, final String propertyName,
        final String separator) {
    List list = extractToList(collection, propertyName);
    return StringUtils.join(list, separator);
}

From source file:hydrograph.ui.propertywindow.runconfig.Notification.java

/**
 * // w  w w . j av a2  s  . c  o m
 * Returns combined message for all added notifications
 * 
 * @return String - error message
 */
public String errorMessage() {
    return StringUtils.join(errors, ",\n");
}

From source file:com.hp.alm.ali.idea.translate.filter.MultipleItemsResolver.java

@Override
public String toRESTQuery(String value) {
    LinkedList<String> list = new LinkedList<String>();
    for (String item : Arrays.asList(value.split(";"))) {
        if (NO_VALUE.equals(item)) {
            list.add(NO_VALUE);//from   w  w  w.  j  a  v a2s .c  o m
        } else {
            list.add("\"" + item + "\"");
        }
    }
    return StringUtils.join(list, " OR ");
}

From source file:com.opengamma.web.analytics.formatting.ValuePropertiesFormatter.java

ValuePropertiesFormatter() {
    super(ValueProperties.class);
    addFormatter(new Formatter<ValueProperties>(Format.EXPANDED) {
        @Override/*from w w  w.j a  v  a  2 s  .c  om*/
        Map<String, Object> format(ValueProperties properties, ValueSpecification valueSpec, Object inlineKey) {
            Set<String> names = properties.getProperties();
            List<List<String>> matrix = Lists.newArrayListWithCapacity(names.size());
            List<String> yLabels = Lists.newArrayListWithCapacity(names.size());
            for (String name : names) {
                Set<String> values = properties.getValues(name);
                boolean optional = properties.isOptional(name);
                List<String> row = Lists.newArrayListWithCapacity(2);
                row.add(StringUtils.join(values, ", "));
                row.add(optional ? "true" : "false");
                matrix.add(row);
                yLabels.add(name);
            }
            Map<String, Object> output = Maps.newHashMap();
            output.put(LabelledMatrix2DFormatter.MATRIX, matrix);
            // TODO it would be good if the UI could handle a label for the first column: "Property"
            output.put(LabelledMatrix2DFormatter.X_LABELS, Lists.newArrayList("Property", "Value", "Optional"));
            output.put(LabelledMatrix2DFormatter.Y_LABELS, yLabels);
            return output;
        }
    });
}

From source file:com.github.hexocraft.random.items.command.RiCommandReload.java

public RiCommandReload(RandomItemsPlugin plugin) {
    super(plugin, Permissions.ADMIN.toString());
    this.setDescription(StringUtils.join(plugin.messages.cReload, "\n"));
}

From source file:io.s4.core.Key.java

public String get(T event) {
    List<String> keys = getList(event);

    return StringUtils.join(keys, separator);
}