本文整理汇总了Java中org.apache.commons.lang3.text.StrBuilder.toString方法的典型用法代码示例。如果您正苦于以下问题:Java StrBuilder.toString方法的具体用法?Java StrBuilder.toString怎么用?Java StrBuilder.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.text.StrBuilder
的用法示例。
在下文中一共展示了StrBuilder.toString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAlgorithmsListing
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
/**
* List available algorithms. This is displayed to the user when no valid
* algorithm is given in the program parameterization.
*
* @return usage string listing available algorithms
*/
private static String getAlgorithmsListing() {
StrBuilder strBuilder = new StrBuilder();
strBuilder
.appendNewLine()
.appendln("Select an algorithm to view usage: flink run examples/flink-gelly-examples_<version>.jar --algorithm <algorithm>")
.appendNewLine()
.appendln("Available algorithms:");
for (Driver algorithm : driverFactory) {
strBuilder.append(" ")
.appendFixedWidthPadRight(algorithm.getName(), 30, ' ')
.append(algorithm.getShortDescription()).appendNewLine();
}
return strBuilder.toString();
}
示例2: boxedAnnouncement
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
/**
* Boxed announcement.
*
* @param color the color
* @param color2 the color 2
* @param style the style
* @param character the character
* @param hColor the h color
* @param hStyle the h style
* @param heading the heading
* @param messages the messages
* @return the string
*/
public static String boxedAnnouncement(final ChatColor color, final ChatColor color2, final ChatColor style, char character, final ChatColor hColor, ChatColor hStyle, String heading, String... messages) {
StrBuilder sb = new StrBuilder();
sb.setNewLineText("\n");
sb.append(" ").appendNewLine().append(" ").appendNewLine().append(" ").appendNewLine();
sb.append(fullLine(color, color2, style, character)).appendNewLine();
sb.append(" ").appendNewLine();
sb.append(centeredHeading(hColor, hStyle, heading)).appendNewLine();
sb.append(" ").appendNewLine();
sb.append(ChatColor.translateAlternateColorCodes('&', messages[0])).appendNewLine();
sb.append(" ").appendNewLine();
sb.append(fullLine(color2, color, style, character)).appendNewLine();
return sb.toString();
}
示例3: createExpectedResultString
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
private String createExpectedResultString(final String errorMsg, final Object... extras) {
String success = errorMsg != null ? "ERROR" : "SUCCESS";
StrBuilder sb = new StrBuilder(250);
sb.setNullText("");
String result = String.format(EXP_RESULT_TEMPLATE, timestamp, success, trimToEmpty(errorMsg), localhost, executionId,
requestId);
sb.append(result);
if (extras != null) {
for (Object extra : extras) {
sb.append(";\"");
sb.append(extra);
sb.append("\"");
}
}
return sb.toString();
}
示例4: dumpTrie
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
public String dumpTrie(boolean compact) {
if (root == null) return "<empty>";
encode();
StrBuilder ret = new StrBuilder();
List<String> strings = root.dumpTrieNode(compact);
ret.append("Root: " + hash2str(getRootHash(), compact) + "\n");
for (String s : strings) {
ret.append(s).append('\n');
}
return ret.toString();
}
示例5: getHeader
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
private String getHeader() {
TMemberService tMemberService = SingletonS2Container.getComponent(TMemberService.class);
if (sendMemberID != null) {
TMember tMember = tMemberService.findById(sendMemberID);
StrBuilder builder = new StrBuilder();
builder.append("\"");
builder.append(tMember.hname);
builder.append("\"");
builder.append("さんより");
builder.append("\n");
builder.append("\n");
return builder.toString();
}
return null;
}
示例6: getFooder
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
private String getFooder() {
StrBuilder builder = new StrBuilder();
builder.append("\n");
builder.append("////////////////////////////////\n");
builder.append("神楽坂一丁目通信局");
builder.append("\n");
builder.append(ConfigUtil.getConfig("web.uri") + "login/");
builder.append("\n");
builder.append("\n");
return builder.toString();
}
示例7: toString
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
StrBuilder string = new StrBuilder();
string.append("hname:");
string.append(hname);
string.append(" mail:");
string.append(mail);
string.append(" userName:");
string.append(userName);
string.append(" pw:");
string.append(password);
return string.toString();
}
示例8: formatLogEntry
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
@Override
protected String formatLogEntry(BotLogEntry entry) {
StrBuilder sb = new StrBuilder();
sb.append(getDateFormat().format(entry.getTimestamp()));
sb.append(entry.getMessage());
return sb.toString();
}
示例9: formatLogEntry
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
/**
* Base method to convert log entry to String. Default format would be like Wed, 4 Jul 2001 12:08:56 -0700 INFO This is a test message
*
* @param entry log entry
* @return string representation of log entry
*/
protected String formatLogEntry(BotLogEntry entry) {
StrBuilder sb = new StrBuilder();
sb.append(getDateFormat().format(entry.getTimestamp()));
sb.appendFixedWidthPadLeft(entry.getSeverity().getAbbreviation(), 7, ' ');
sb.appendSeparator(' ').append(entry.getMessage());
return sb.toString();
}
示例10: getUsage
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
@Override
public String getUsage() {
StrBuilder strBuilder = new StrBuilder();
// print parameters as ordered list
for (Parameter<?> parameter : parameters) {
if (!parameter.isHidden()) {
strBuilder
.append(parameter.getUsage())
.append(" ");
}
}
return strBuilder.toString();
}
示例11: buildLongDescr
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
/**
* Creates a long description with supported targets.
* @param descr original long description
* @param supportedTargets targets
* @return long description with added list of supported targets
* @throws NullPointerException if argument was null
* @throw IllegalArgumentException if target had null elements
*/
protected static String buildLongDescr(String descr, SvgTargets[] supportedTargets){
Validate.notNull(supportedTargets);
Validate.noNullElements(supportedTargets);
StrBuilder ret = new StrBuilder();
ret.append(descr);
ret.append(" Supported targets are: ").appendWithSeparators(supportedTargets, ", ");
return ret.toString();
}
示例12: centeredHeading
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
/**
* Centered heading.
* <p>Centres the text to be exactly in the middle of the line with white space used for padding either side.
* The max length of the heading string is 26 characters.
*
* @param color the color
* @param style the style
* @param heading the heading text
* @return the centered heading string
*/
public static String centeredHeading(ChatColor color, ChatColor style, String heading) {
Validate.notNull(color);
Validate.notNull(style);
Validate.isTrue(heading.length() < 27, "The maximum length of the heading is 26 Characters");
int left = 26 - heading.length();
int offSet = 0;
int outSet = 0;
if (!((Integer) left < 1)) {
if (left == 1) {
offSet = 1;
} else if (left == 2) {
offSet = 1;
outSet = 1;
} else if (left > 0 && left % 2 == 1) {
offSet = (left / 2) + 1;
outSet = left / 2;
} else {
offSet = left / 2;
outSet = offSet;
}
}
StrBuilder sb = new StrBuilder(58);
sb.append(" ").appendPadding(19 + offSet, ' ').append(style).append("").append(color).append(heading).appendPadding(8 + offSet, ' ');
return sb.toString();
}
示例13: generateClearActions
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
private String generateClearActions() throws IOException {
StrBuilder sb = new StrBuilder();
sb.append("<p>Actions :</p><form action='?p=batch' method='post'><input type='submit' name='" + CLEAR_OLD //
+ "' value='Delete old (6 months)' class='btn'/> <input type='submit' name='" + CLEAR_SUCCESS //
+ "' value='Delete Success w/o rejected' class='btn'/></form>");
return sb.toString();
}
示例14: computeFullyQualifiedMethodName
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
public static String computeFullyQualifiedMethodName(final String className, final String methodName, final Type[] argumentTypes) {
StrBuilder sb = new StrBuilder(50);
sb.append(abbreviatePackageName(className));
sb.append('.');
sb.append(methodName);
sb.append('(');
for (int i = 0; i < argumentTypes.length; ++i) {
sb.appendSeparator(", ", i);
sb.append(abbreviatePackageName(argumentTypes[i].getClassName()));
}
sb.append(')');
return sb.toString();
}
示例15: initColumns
import org.apache.commons.lang3.text.StrBuilder; //导入方法依赖的package包/类
private void initColumns() {
StrBuilder sb = new StrBuilder(256);
if (headers == null) {
// Create a column for every data set key
DataSet dataSet = currentDataSetsProvider.get().get(dataSetKey);
checkNotNull(dataSet, "No data set available for key: " + dataSetKey);
Set<String> keysSet = dataSet.getDataView().keySet();
columns = newArrayListWithCapacity(keysSet.size());
for (String key : keysSet) {
columns.add(new Column(key, dataSetKey));
appendEscapedAndQuoted(sb, dataSetKey + ' ' + key);
}
} else {
columns = newArrayListWithCapacity(headers.size());
for (String h : headers) {
columns.add(new Column(h));
appendEscapedAndQuoted(sb, h);
}
}
// additional default columns
appendEscapedAndQuoted(sb, JFunkConstants.CURRENT_MODULE_NAME);
appendEscapedAndQuoted(sb, JFunkConstants.CURRENT_MODULE_RESULT);
appendEscapedAndQuoted(sb, JFunkConstants.CURRENT_MODULE_ERROR);
header = sb.toString();
}