当前位置: 首页>>代码示例>>Java>>正文


Java StrBuilder.toString方法代码示例

本文整理汇总了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();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:24,代码来源:Runner.java

示例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();


}
 
开发者ID:Relicum,项目名称:Ipsum,代码行数:31,代码来源:StringStyles.java

示例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();
}
 
开发者ID:mgm-tp,项目名称:perfload-logging,代码行数:19,代码来源:DefaultResultLoggerTest.java

示例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();
}
 
开发者ID:talentchain,项目名称:talchain,代码行数:12,代码来源:TrieImpl.java

示例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;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:16,代码来源:MailManager.java

示例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();
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:12,代码来源:MailManager.java

示例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();
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:14,代码来源:MemberUploadCsv.java

示例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();
}
 
开发者ID:waveaccess,项目名称:msbotframework4j,代码行数:8,代码来源:Slf4jBotLogger.java

示例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();
}
 
开发者ID:waveaccess,项目名称:msbotframework4j,代码行数:14,代码来源:AbstractBotLogger.java

示例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();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:16,代码来源:ParameterizedBase.java

示例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();
}
 
开发者ID:vdmeer,项目名称:svg2vector,代码行数:18,代码来源:AO_TargetExt.java

示例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();
}
 
开发者ID:Relicum,项目名称:Ipsum,代码行数:42,代码来源:StringStyles.java

示例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();
}
 
开发者ID:appstatus,项目名称:appstatus,代码行数:8,代码来源:BatchPage.java

示例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();
}
 
开发者ID:mgm-tp,项目名称:perfload-agent,代码行数:14,代码来源:ClassNameUtils.java

示例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();
}
 
开发者ID:mgm-tp,项目名称:jfunk,代码行数:33,代码来源:CsvReporter.java


注:本文中的org.apache.commons.lang3.text.StrBuilder.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。