List of utility methods to do Comma Separated List
String | getCommaSeparatedList(List Turn a list of Strings into a concatenated string of filenames StringBuffer sb = new StringBuffer(); for (Iterator<String> i = list.iterator(); i.hasNext();) { sb.append(i.next()); if (i.hasNext()) { sb.append(","); return sb.toString(); ... |
String | getCommaSeparatedListOfString(Collection get Comma Separated List Of String return getCommaSeparatedListOfString(list, "(", ")", true); |
String | getCommaSeparatedValue(List extends Enum>> enumList) Gets the comma separated value. StringBuffer stringBuffer = new StringBuffer(); for (Enum<?> element : enumList) { if (stringBuffer.length() != 0) { stringBuffer.append(","); stringBuffer.append(element.name()); return stringBuffer.toString(); ... |
String | getCommaSeparatedValues(List Returns the specified list of values as a String representing a comma-separated list of values.
if (null == values || values.size() == 0) return ""; StringBuilder b = new StringBuilder("'").append(values.get(0)).append("'"); for (int i = 1, len = values.size(); i < len; i++) { b.append(",'").append(values.get(i)).append("'"); return b.toString(); |
String | getListAsCommaSeparatedString(List get List As Comma Separated String if (list == null || list.isEmpty()) { return null; StringBuilder sb = new StringBuilder(); for (String key : list) { sb.append(key); sb.append(","); sb.setLength(sb.length() - 1); return sb.toString(); |
String | getStringList(List> list, boolean useComma, boolean useBrackets, String comma) List the toString out put of the objects in the List that can be comma separated. StringBuffer buffer = new StringBuffer(); if (!useComma) { comma = ""; if (list != null) { if (useBrackets) { buffer.append("("); for (int i = 0; i < list.size(); i++) { buffer.append(list.get(i)).append((i < list.size() - 1) ? comma : ""); if (useBrackets) { buffer.append(")"); return buffer.toString(); |
List | getStringListFromCommaSeparatedString(String input) get String List From Comma Separated String List<String> list = new ArrayList<String>(); if (!input.isEmpty()) { String[] toArray = input.split(","); list.addAll(Arrays.asList(toArray)); return list; |
String | humanReadableCommandLineOutput(List Build a human readable command line from the arguments set by the plugin String debugOutput = ""; for (String argument : arguments) { debugOutput += argument + " "; return debugOutput.trim(); |
String | implodeCommaAnd(List implode Comma And if (list.size() == 0) return ""; if (list.size() == 1) return list.get(0); String lastItem = list.get(list.size() - 1); String nextToLastItem = list.get(list.size() - 2); String merge = nextToLastItem + and + lastItem; list.set(list.size() - 2, merge); ... |
String | listToComma(List list) list To Comma StringBuilder sb = new StringBuilder(); for (int i = 0; i < list.size(); i++) { sb.append(String.valueOf(list.get(i))); if (i < list.size() - 1) { sb.append(","); return sb.toString(); ... |