@Test public void testBuild() { CharTagMap tm = instance.withTagSize(3) .withLengthSize(2) .build(); tm.unpack("XYZ19The quick brown foxKV107Foo Bar"); assertEquals("The quick brown fox", tm.getTagValue("XYZ")); assertEquals("Foo Bar", tm.getTagValue("KV1")); String result = tm.pack(); tm.clear(); tm.unpack(result); assertEquals("The quick brown fox", tm.getTagValue("XYZ")); assertEquals("Foo Bar", tm.getTagValue("KV1")); }
public CharTagMap build() throws IllegalArgumentException { CharTagMap tm = CharTagMap.getInstance(); if (tagSize != null) tm.setTagSize(tagSize); if (lengthSize != null) tm.setLengthSize(lengthSize); tm.withTagLengthSwap(swapTagWithLength); return tm; }
CharTagMapBuilder { public CharTagMap build() throws IllegalArgumentException { CharTagMap tm = CharTagMap.getInstance(); if (tagSize != null) tm.setTagSize(tagSize); if (lengthSize != null) tm.setLengthSize(lengthSize); tm.withTagLengthSwap(swapTagWithLength); return tm; } }
CharTagMapBuilder { public CharTagMap build() throws IllegalArgumentException { CharTagMap tm = CharTagMap.getInstance(); if (tagSize != null) tm.setTagSize(tagSize); if (lengthSize != null) tm.setLengthSize(lengthSize); tm.withTagLengthSwap(swapTagWithLength); return tm; } CharTagMapBuilder(); }
CharTagMapBuilder { public CharTagMap build() throws IllegalArgumentException { CharTagMap tm = CharTagMap.getInstance(); if (tagSize != null) tm.setTagSize(tagSize); if (lengthSize != null) tm.setLengthSize(lengthSize); tm.withTagLengthSwap(swapTagWithLength); return tm; } CharTagMapBuilder(); CharTagMapBuilder withLengthSize(int size); CharTagMapBuilder withTagSize(int size); CharTagMapBuilder withTagLengthSwap(boolean swap); CharTagMap build(); }
CharTagMapBuilder { public CharTagMap build() throws IllegalArgumentException { CharTagMap tm = CharTagMap.getInstance(); if (tagSize != null) tm.setTagSize(tagSize); if (lengthSize != null) tm.setLengthSize(lengthSize); tm.withTagLengthSwap(swapTagWithLength); return tm; } CharTagMapBuilder(); CharTagMapBuilder withLengthSize(int size); CharTagMapBuilder withTagSize(int size); CharTagMapBuilder withTagLengthSwap(boolean swap); CharTagMap build();  }