Example usage for io.netty.util.internal StringUtil NEWLINE

List of usage examples for io.netty.util.internal StringUtil NEWLINE

Introduction

In this page you can find the example usage for io.netty.util.internal StringUtil NEWLINE.

Prototype

String NEWLINE

To view the source code for io.netty.util.internal StringUtil NEWLINE.

Click Source Link

Usage

From source file:com.twitter.http2.DefaultHttpDataFrame.java

License:Apache License

@Override
public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(StringUtil.simpleClassName(this));
    buf.append("(last: ");
    buf.append(isLast());//w  ww .j av  a  2s. c  o m
    buf.append(')');
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Stream-ID = ");
    buf.append(getStreamId());
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Size = ");
    if (refCnt() == 0) {
        buf.append("(freed)");
    } else {
        buf.append(content().readableBytes());
    }
    return buf.toString();
}

From source file:com.twitter.http2.DefaultHttpGoAwayFrame.java

License:Apache License

@Override
public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(StringUtil.simpleClassName(this));
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Last-Stream-ID = ");
    buf.append(getLastStreamId());/*from  w w w .j a  v  a  2  s . c o  m*/
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Error Code: ");
    buf.append(getErrorCode().toString());
    return buf.toString();
}

From source file:com.twitter.http2.DefaultHttpHeaderBlockFrame.java

License:Apache License

protected void appendHeaders(StringBuilder buf) {
    for (Map.Entry<String, String> e : headers()) {
        buf.append("    ");
        buf.append(e.getKey());//from w w w  . j  a  va 2s  .  com
        buf.append(": ");
        buf.append(e.getValue());
        buf.append(StringUtil.NEWLINE);
    }
}

From source file:com.twitter.http2.DefaultHttpHeadersFrame.java

License:Apache License

@Override
public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(StringUtil.simpleClassName(this));
    buf.append("(last: ");
    buf.append(isLast());/*from w w  w  .  j  a va 2 s . c o m*/
    buf.append(')');
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Stream-ID = ");
    buf.append(getStreamId());
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Dependency = ");
    buf.append(getDependency());
    buf.append(" (exclusive: ");
    buf.append(isExclusive());
    buf.append(", weight: ");
    buf.append(getWeight());
    buf.append(')');
    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();
}

From source file:com.twitter.http2.DefaultHttpPingFrame.java

License:Apache License

@Override
public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(StringUtil.simpleClassName(this));
    buf.append("(pong: ");
    buf.append(isPong());/*from  www.  j a  v  a 2  s.c o  m*/
    buf.append(')');
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Data = ");
    buf.append(getData());
    return buf.toString();
}

From source file:com.twitter.http2.DefaultHttpPriorityFrame.java

License:Apache License

@Override
public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(StringUtil.simpleClassName(this));
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Stream-ID = ");
    buf.append(getStreamId());//  w ww.j  a v  a 2  s  .  co  m
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Dependency = ");
    buf.append(getDependency());
    buf.append(" (exclusive: ");
    buf.append(isExclusive());
    buf.append(", weight: ");
    buf.append(getWeight());
    buf.append(')');
    return buf.toString();
}

From source file:com.twitter.http2.DefaultHttpPushPromiseFrame.java

License:Apache License

@Override
public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(StringUtil.simpleClassName(this));
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Stream-ID = ");
    buf.append(getStreamId());/*from   w  w  w  .j  a va  2s .  co m*/
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Promised-Stream-ID = ");
    buf.append(getPromisedStreamId());
    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();
}

From source file:com.twitter.http2.DefaultHttpRstStreamFrame.java

License:Apache License

@Override
public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(StringUtil.simpleClassName(this));
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Stream-ID = ");
    buf.append(getStreamId());// w ww. j  ava 2s .c om
    buf.append(StringUtil.NEWLINE);
    buf.append("--> Error Code: ");
    buf.append(getErrorCode().toString());
    return buf.toString();
}

From source file:com.twitter.http2.DefaultHttpSettingsFrame.java

License:Apache License

private void appendSettings(StringBuilder buf) {
    for (Map.Entry<Integer, Integer> e : getSettings()) {
        buf.append("--> ");
        buf.append(e.getKey().toString());
        buf.append(':');
        buf.append(e.getValue().toString());
        buf.append(StringUtil.NEWLINE);
    }/*w w  w .j a v a 2 s.  c  o m*/
}

From source file:com.twitter.http2.DefaultHttpSettingsFrame.java

License:Apache License

@Override
public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(StringUtil.simpleClassName(this));
    buf.append("(ack: ");
    buf.append(isAck());/*from  ww  w  .j  ava 2  s  .  c om*/
    buf.append(')');
    buf.append(StringUtil.NEWLINE);
    appendSettings(buf);
    buf.setLength(buf.length() - StringUtil.NEWLINE.length());
    return buf.toString();
}