JBBPFieldTypeParameterContainer implements Serializable { @Override public String toString() { final StringBuilder result = new StringBuilder(); if (byteOrder == JBBPByteOrder.LITTLE_ENDIAN) { result.append('<'); } result.append(this.typeName); if (extraData != null) { int insertIndex = typeName.indexOf(' '); if (insertIndex < 0) { insertIndex = result.length(); } else { insertIndex++; } result.insert(insertIndex, ':' + extraData); } return result.toString(); } JBBPFieldTypeParameterContainer(final JBBPByteOrder byteOrder, final String typeName, final String extraData); JBBPByteOrder getByteOrder(); String getTypeName(); String getExtraData(); String getExtraDataExpression(); boolean hasExpressionAsExtraData(); boolean isSpecialField(); @Override String toString();  }
@Test public void testToString() { assertEquals("int hello", new JBBPFieldTypeParameterContainer(JBBPByteOrder.BIG_ENDIAN, "int hello", null).toString()); assertEquals("<int hello", new JBBPFieldTypeParameterContainer(JBBPByteOrder.LITTLE_ENDIAN, "int hello", null).toString()); assertEquals("<bit:8 hello", new JBBPFieldTypeParameterContainer(JBBPByteOrder.LITTLE_ENDIAN, "bit hello", "8").toString()); assertEquals("<bit:8", new JBBPFieldTypeParameterContainer(JBBPByteOrder.LITTLE_ENDIAN, "bit", "8").toString()); }