TextParameterDataSegment extends AbstractDataSegment { public final void add (final OperationalTextKey textKey, final String value) { final String s = textKey.value() + KEY_VALUE_DELIMITER + value + PAIR_DELIMITER; resizeBuffer(s.length(), true); dataBuffer.put(s.getBytes()); isDirty = true; } TextParameterDataSegment(final int initChunkSize); final void add(final OperationalTextKey textKey, final String value); final void addAll(final SettingsMap textKeys); final int append(final ByteBuffer src, final int len); final int deserialize(final ByteBuffer src, final int len); final SettingsMap getSettings(); final void clear(); final boolean equals(final Object anObject); @Override final int hashCode();  }
@Test public final void testAdd () throws Exception { final TextParameterDataSegment dataSegment = new TextParameterDataSegment(CHUNK_SIZE); assertNotNull(dataSegment); dataSegment.add(OperationalTextKey.DATA_DIGEST, "Yes"); dataSegment.add(OperationalTextKey.HEADER_DIGEST, "No"); dataSegment.add(OperationalTextKey.MAX_CONNECTIONS, "50"); assertEquals(3, dataSegment.getSettings().entrySet().size()); assertFalse(dataSegment.getSettings().entrySet().isEmpty()); }