use of org.apache.commons.lang3.text.StrBuilder in project coprhd-controller by CoprHD.
the class TextUtils method formatCSV.
/**
* Formats some values into comma-separated text.
*
* @param values
* the values to format.
* @return the CSV text.
*/
public static String formatCSV(Iterable<String> values) {
StrBuilder sb = new StrBuilder();
for (String value : values) {
sb.appendSeparator(",");
sb.append("\"");
if (StringUtils.isNotEmpty(value)) {
for (int i = 0; i < value.length(); i++) {
char ch = value.charAt(i);
if (ch == '"') {
sb.append('"');
}
sb.append(ch);
}
}
sb.append("\"");
}
return sb.toString();
}
use of org.apache.commons.lang3.text.StrBuilder in project flink by apache.
the class Usage method getUsage.
private static String getUsage() {
StrBuilder strBuilder = new StrBuilder();
strBuilder.appendNewLine();
strBuilder.appendln("Driver classes call algorithms from the Gelly library:");
for (Class cls : DRIVERS) {
strBuilder.append(" ").appendln(cls.getName());
}
strBuilder.appendNewLine();
strBuilder.appendln("Example classes illustrate Gelly APIs or alternative algorithms:");
for (Class cls : EXAMPLES) {
strBuilder.append(" ").appendln(cls.getName());
}
return strBuilder.toString();
}
use of org.apache.commons.lang3.text.StrBuilder in project RoboBinding by RoboBinding.
the class SourceCodeAssert method withSpacesRemoved.
private static String withSpacesRemoved(String text) {
StrBuilder sb = new StrBuilder(text);
sb.deleteAll("\r");
sb.deleteAll("\t");
sb.deleteAll("\n");
sb.deleteAll(" ");
return sb.toString();
}
use of org.apache.commons.lang3.text.StrBuilder in project checker-framework by typetools.
the class GradleExample method main.
public static void main(final String[] args) {
System.out.println("Hello World!");
StrBuilder stb = new StrBuilder();
// error on this line
@NonNull Object nn = nullable;
System.out.println(nn);
List<@NonNull String> list = new ArrayList<>();
// error on this line
list.add(null);
}
use of org.apache.commons.lang3.text.StrBuilder in project blue by kunstmusik.
the class Note method toString.
@Override
public String toString() {
StrBuilder temp = new StrBuilder();
int strSize = 1;
for (int i = 0; i < fields.length; i++) {
strSize += fields[i].length() + 1;
}
temp.ensureCapacity(strSize);
temp.append("i");
int size = fields.length;
for (int i = 0; i < size; i++) {
if (i == 2) {
if (this.isTied) {
temp.append("-");
}
temp.append(NumberUtilities.formatDouble(subjectiveDuration)).append("\t");
} else {
temp.append(fields[i]);
if (i < size - 1) {
temp.append("\t");
}
}
}
return temp.toString();
}
Aggregations