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(Object[] array) 

Source Link

Document

Joins the elements of the provided array into a single String containing the provided list of elements.

Usage

From source file:com.intuit.tank.harness.test.data.VariablesTest.java

public static String concat(String... s) {
    return StringUtils.join(s);
}

From source file:com.titankingdoms.dev.titanchat.command.defaults.KickCommand.java

@Override
public void execute(CommandSender sender, Channel channel, String[] args) {
    Participant participant = plugin.getParticipantManager().getParticipant(args[0]);

    if (!channel.isLinked(plugin.getParticipantManager().getParticipant(sender))) {
        sendMessage(sender, participant.getDisplayName() + " &4is not on the channel");
        return;//from ww  w .  j av a  2s .c o m
    }

    String reason = StringUtils.join(Arrays.copyOfRange(args, 1, args.length));

    channel.unlink(participant);
    participant.notice("&4You have been kicked from " + channel.getName() + ": " + reason);

    if (!channel.isLinked(plugin.getParticipantManager().getParticipant(sender)))
        sendMessage(sender, participant.getDisplayName() + " &6has been kicked");

    channel.notice(participant.getDisplayName() + " &6has been kicked");
}

From source file:com.uber.stream.kafka.mirrormaker.common.utils.ManagerRequestURLBuilder.java

public Request getTopicCreationRequestUrl(String topic, String src, String dst) {
    String requestUrl = StringUtils
            .join(new String[] { _baseUrl, "/topics/", topic, "?src=", src, "&dst=", dst });

    Request request = new Request(Method.POST, requestUrl);

    return request;
}

From source file:com.intel.cosbench.exporter.CSVStageExporter.java

protected void writeHeader(Writer writer) throws IOException {
    StringBuilder buffer = new StringBuilder();
    buffer.append("Timestamp").append(',');
    char[] cs = new char[numOpTypes];
    Arrays.fill(cs, ',');
    String suffix = new String(cs);
    buffer.append("Op-Count").append(suffix);
    buffer.append("Byte-Count").append(suffix);
    buffer.append("Avg-ResTime").append(suffix);
    buffer.append("Avg-ProcTime").append(suffix);
    buffer.append("Throughput").append(suffix);
    buffer.append("Bandwidth").append(suffix);
    buffer.append("Succ-Ratio").append(suffix);
    buffer.append("Version-Info");
    buffer.append(',').append(',').append('\n').append(',');
    for (int i = 0; i < 7; i++)
        // 7 metrics
        for (Metrics metrics : snapshots[0].getReport())
            buffer.append(StringUtils.join(new Object[] {
                    (metrics.getOpName().equals(metrics.getSampleType()) ? null : metrics.getOpName() + "-"),
                    metrics.getSampleType() })).append(',');
    buffer.append("Min-Version").append(',');
    buffer.append("Version").append(',');
    buffer.append("Max-Version").append('\n');
    writer.write(buffer.toString());//w ww  .j  a v a2s .c  om
}