本文整理汇总了Java中org.jboss.netty.util.internal.StringUtil类的典型用法代码示例。如果您正苦于以下问题:Java StringUtil类的具体用法?Java StringUtil怎么用?Java StringUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringUtil类属于org.jboss.netty.util.internal包,在下文中一共展示了StringUtil类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append("(last: ");
buf.append(isLast());
buf.append(')');
buf.append(StringUtil.NEWLINE);
buf.append("--> Stream-ID = ");
buf.append(streamId);
buf.append(StringUtil.NEWLINE);
buf.append("--> Headers:");
buf.append(StringUtil.NEWLINE);
appendHeaders(buf);
// Remove the last newline.
buf.setLength(buf.length() - StringUtil.NEWLINE.length());
return buf.toString();
}
开发者ID:jle,项目名称:andy,代码行数:20,代码来源:DefaultSpdyHeadersFrame.java
示例2: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append("(last: ");
buf.append(isLast());
buf.append("; compressed: ");
buf.append(isCompressed());
buf.append(')');
buf.append(StringUtil.NEWLINE);
buf.append("--> Stream-ID = ");
buf.append(streamId);
buf.append(StringUtil.NEWLINE);
buf.append("--> Size = ");
buf.append(data.readableBytes());
return buf.toString();
}
开发者ID:jle,项目名称:andy,代码行数:18,代码来源:DefaultSpdyDataFrame.java
示例3: sendMessage
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
public void sendMessage(SipRequest request) throws Exception {
// initial line
StringBuffer buf = new StringBuffer(String.format("%s %s %s", request.getMethod().name(),
request.getUri(), request.getVersion().toString()));
buf.append(StringUtil.NEWLINE);
// headers
for (Map.Entry<String, List<String>> header : request.getHeaders().entrySet()) {
buf.append(header.getKey());
buf.append(": ");
buf.append(StringUtils.arrayToDelimitedString(header.getValue().toArray(), "\n"));
buf.append(StringUtil.NEWLINE);
}
buf.append(StringUtil.NEWLINE);
// content
ChannelBuffer content = request.getContent();
if (content.readable()) {
buf.append(content.toString(CharsetUtil.UTF_8)).append(StringUtil.NEWLINE);
}
sendMessage(null, buf.toString());
}
开发者ID:elasticsoftwarefoundation,项目名称:elasterix,代码行数:25,代码来源:SipClient.java
示例4: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getVersion().name()).append(' ');
buf.append(getResponseStatus().getCode()).append(' ');
buf.append(getResponseStatus().getReasonPhrase());
if(StringUtils.hasLength(getResponseStatus().getOptionalMessage())) {
buf.append(String.format(" (%s)", getResponseStatus().getOptionalMessage()));
}
buf.append(StringUtil.NEWLINE);
appendHeaders(buf);
if(getContent() != null) {
buf.append(StringUtil.NEWLINE);
buf.append(getContent().toString(Charset.forName("UTF-8")));
}
// Remove the last newline.
buf.setLength(buf.length() - StringUtil.NEWLINE.length());
return buf.toString();
}
开发者ID:elasticsoftwarefoundation,项目名称:elasterix,代码行数:22,代码来源:SipResponseImpl.java
示例5: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(String.format("%s %s %s", getMethod().name(), getUri(), getVersion().name()));
buf.append(StringUtil.NEWLINE);
appendHeaders(buf);
if(getContent() != null) {
buf.append(StringUtil.NEWLINE);
buf.append(getContent().toString(Charset.forName("UTF-8")));
}
// Remove the last newline.
buf.setLength(buf.length() - StringUtil.NEWLINE.length());
return buf.toString();
}
开发者ID:elasticsoftwarefoundation,项目名称:elasterix,代码行数:17,代码来源:SipRequestImpl.java
示例6: BinlogEventListener
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
public BinlogEventListener(BinaryLogClient binaryLogClient, KafkaProducer kafkaProducer) {
this.binaryLogClient = binaryLogClient;
this.tableMap = new HashMap<Long, Table>();
this.kafkaProducer = kafkaProducer;
this.gtidSet = binaryLogClient.getGtidSet();
this.replicateTables = new HashSet<String>();
for(String fqTable: StringUtil.split(App.config.getProperty("replicateTables"), ',')) {
String cleanFqTable = fqTable.trim();
if(cleanFqTable.length() > 0)
replicateTables.add(cleanFqTable);
}
}
开发者ID:mrkamel,项目名称:replicaza,代码行数:16,代码来源:BinlogEventListener.java
示例7: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append("(chunked: ");
buf.append(isChunked());
buf.append(')');
buf.append(StringUtil.NEWLINE);
buf.append(getProtocolVersion().getText());
buf.append(' ');
buf.append(getStatus().toString());
buf.append(StringUtil.NEWLINE);
for (Map.Entry<String, String> e : headers()) {
buf.append(e.getKey());
buf.append(": ");
buf.append(e.getValue());
buf.append(StringUtil.NEWLINE);
}
buf.setLength(buf.length() - StringUtil.NEWLINE.length());
buf.append(StringUtil.NEWLINE);
//may have many lines here
if(!getContentText().isEmpty()) {
buf.append("text content: ");
buf.append(StringUtil.NEWLINE);
buf.append(getContentText());
}
// Remove the last newline.
return buf.toString();
}
开发者ID:mirasworks,项目名称:works,代码行数:32,代码来源:WorksResponse.java
示例8: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
if (getRemoteAddress() == getChannel().getRemoteAddress()) {
return getChannel().toString() + " RECEIVED: " +
StringUtil.stripControlCharacters(getMessage());
} else {
return getChannel().toString() + " RECEIVED: " +
StringUtil.stripControlCharacters(getMessage()) + " from " +
getRemoteAddress();
}
}
开发者ID:nyankosama,项目名称:simple-netty-source,代码行数:12,代码来源:UpstreamMessageEvent.java
示例9: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
if (getRemoteAddress() == getChannel().getRemoteAddress()) {
return getChannel().toString() + " WRITE: " +
StringUtil.stripControlCharacters(getMessage());
} else {
return getChannel().toString() + " WRITE: " +
StringUtil.stripControlCharacters(getMessage()) + " to " +
getRemoteAddress();
}
}
开发者ID:nyankosama,项目名称:simple-netty-source,代码行数:12,代码来源:DownstreamMessageEvent.java
示例10: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append(StringUtil.NEWLINE);
buf.append("--> Stream-ID = ");
buf.append(streamId);
buf.append(StringUtil.NEWLINE);
buf.append("--> Status: ");
buf.append(status.toString());
return buf.toString();
}
开发者ID:jle,项目名称:andy,代码行数:13,代码来源:DefaultSpdyRstStreamFrame.java
示例11: appendSettings
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
private void appendSettings(StringBuilder buf) {
for (Map.Entry<Integer, Setting> e: getSettings()) {
Setting setting = e.getValue();
buf.append("--> ");
buf.append(e.getKey().toString());
buf.append(':');
buf.append(setting.getValue());
buf.append(" (persist value: ");
buf.append(setting.isPersist());
buf.append("; persisted: ");
buf.append(setting.isPersisted());
buf.append(')');
buf.append(StringUtil.NEWLINE);
}
}
开发者ID:jle,项目名称:andy,代码行数:16,代码来源:DefaultSpdySettingsFrame.java
示例12: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append(StringUtil.NEWLINE);
appendSettings(buf);
buf.setLength(buf.length() - StringUtil.NEWLINE.length());
return buf.toString();
}
开发者ID:jle,项目名称:andy,代码行数:10,代码来源:DefaultSpdySettingsFrame.java
示例13: appendHeaders
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
protected void appendHeaders(StringBuilder buf) {
for (Map.Entry<String, String> e: getHeaders()) {
buf.append(" ");
buf.append(e.getKey());
buf.append(": ");
buf.append(e.getValue());
buf.append(StringUtil.NEWLINE);
}
}
开发者ID:jle,项目名称:andy,代码行数:10,代码来源:DefaultSpdyHeaderBlock.java
示例14: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append(StringUtil.NEWLINE);
buf.append("--> ID = ");
buf.append(id);
return buf.toString();
}
开发者ID:jle,项目名称:andy,代码行数:10,代码来源:DefaultSpdyPingFrame.java
示例15: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append(StringUtil.NEWLINE);
buf.append("--> Last-good-stream-ID = ");
buf.append(lastGoodStreamId);
buf.append(StringUtil.NEWLINE);
buf.append("--> Status: ");
buf.append(status.toString());
return buf.toString();
}
开发者ID:jle,项目名称:andy,代码行数:13,代码来源:DefaultSpdyGoAwayFrame.java
示例16: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append("(last: ");
buf.append(isLast());
buf.append("; unidirectional: ");
buf.append(isUnidirectional());
buf.append(')');
buf.append(StringUtil.NEWLINE);
buf.append("--> Stream-ID = ");
buf.append(streamId);
buf.append(StringUtil.NEWLINE);
if (associatedToStreamId != 0) {
buf.append("--> Associated-To-Stream-ID = ");
buf.append(associatedToStreamId);
buf.append(StringUtil.NEWLINE);
}
buf.append("--> Priority = ");
buf.append(priority);
buf.append(StringUtil.NEWLINE);
buf.append("--> Headers:");
buf.append(StringUtil.NEWLINE);
appendHeaders(buf);
// Remove the last newline.
buf.setLength(buf.length() - StringUtil.NEWLINE.length());
return buf.toString();
}
开发者ID:jle,项目名称:andy,代码行数:30,代码来源:DefaultSpdySynStreamFrame.java
示例17: toString
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(getClass().getSimpleName());
buf.append(StringUtil.NEWLINE);
buf.append("--> Stream-ID = ");
buf.append(streamId);
buf.append(StringUtil.NEWLINE);
buf.append("--> Delta-Window-Size = ");
buf.append(deltaWindowSize);
return buf.toString();
}
开发者ID:jle,项目名称:andy,代码行数:13,代码来源:DefaultSpdyWindowUpdateFrame.java
示例18: appendHeaders
import org.jboss.netty.util.internal.StringUtil; //导入依赖的package包/类
protected void appendHeaders(StringBuilder buf) {
for (Map.Entry<String, List<String>> e: getHeaders().entrySet()) {
buf.append(e.getKey());
buf.append(": ");
buf.append(StringUtils.collectionToCommaDelimitedString(e.getValue()));
buf.append(StringUtil.NEWLINE);
}
}
开发者ID:elasticsoftwarefoundation,项目名称:elasterix,代码行数:9,代码来源:SipMessageImpl.java
注:本文中的org.jboss.netty.util.internal.StringUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论