Java Collection to String buildString(Collection keys)

Here you can find the source of buildString(Collection keys)

Description

build String

License

LGPL

Declaration

private static String buildString(Collection<String> keys) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.Collection;

public class Main {
    private static final char OPEN_TABLE_SEPARATOR = '[';
    private static final char CLOSE_TABLE_SEPARATOR = ']';

    private static String buildString(Collection<String> keys) {
        String build = keys.toString();
        if (keys.size() == 1) {
            build = build.replace("" + OPEN_TABLE_SEPARATOR, "").replace("" + CLOSE_TABLE_SEPARATOR, "");
        }//from   w  ww .jav  a  2s  .  c om
        return build;
    }
}

Related

  1. asString(Collection collection)
  2. asStringArr(Collection collection)
  3. asStringArray(Collection coll)
  4. asStringArray(Collection collection)
  5. buildString(Collection args, String seperator, int startingArg, int maxLength)
  6. buildStringFromListForNuma(Collection list)
  7. collectionToCommaDelimitedString(Collection items)
  8. collectionToCommaDelimitedString(Collection list)
  9. collectionToCommaSeparatedString(Collection elementCollection)