Search in sources :

Example 1 with NonNullUtils.nullToEmptyString

use of org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString in project tracecompass by tracecompass.

the class IPv4Packet method getSignificationString.

@Override
protected String getSignificationString() {
    StringBuilder sb = new StringBuilder();
    sb.append(fSourceIpAddress.getHostAddress()).append(// $NON-NLS-1$
    " > ").append(fDestinationIpAddress.getHostAddress());
    String flags = generateFlagString();
    if (!(flags.equals(""))) {
        // $NON-NLS-1$
        sb.append(' ').append('[').append(flags).append(']');
    }
    // $NON-NLS-1$
    sb.append(" Id=").append(fIdentification);
    final ByteBuffer payload = fPayload;
    if (payload != null) {
        // $NON-NLS-1$
        sb.append(" Len=").append(payload.limit());
    } else {
        // $NON-NLS-1$
        sb.append(" Len=0");
    }
    return NonNullUtils.nullToEmptyString(sb);
}
Also used : NonNullUtils.nullToEmptyString(org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString) ByteBuffer(java.nio.ByteBuffer)

Aggregations

ByteBuffer (java.nio.ByteBuffer)1 NonNullUtils.nullToEmptyString (org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString)1