TrieParser implements Serializable { public String toString() { return toString(new StringBuilder()).toString(); } TrieParser();  TrieParser(int size);  TrieParser(int size, boolean skipDeepChecks);  TrieParser(int size, int resultSize, boolean skipDeepChecks, boolean supportsExtraction);  TrieParser(int size, int resultSize, boolean skipDeepChecks, boolean supportsExtraction, boolean ignoreCase);  TrieParser(int size, int resultSize, boolean skipDeepChecks, boolean supportsExtraction, boolean ignoreCase, byte customEscape); byte[] lastSetValueExtractonPattern(); int lastSetValueExtractionCount(); int maxExtractedFields(); static int maxExtractedFields(TrieParser that); static int getLimit(TrieParser that); int getLimit(); boolean isSkipDeepChecks(); void setValue(byte[] source, int offset, int length, int mask, long value); String toString(); StringBuilder toString(StringBuilder builder); void visitPatterns(TrieParserVisitor pv); A toDOT(A builder); int setUTF8Value(CharSequence cs, long value); int setUTF8Value(CharSequence cs, CharSequence suffix, long value); int setUTF8Value(CharSequence prefix, CharSequence cs, CharSequence suffix, long value); void setValue(Pipe p, long value); int longestKnown(); int shortestKnown(); void setMaxBytesCapturable(int value); void setMaxNumericLengthCapturable(int value); void setValue(byte[] bytes, long value); void toDOTFile(File targetFile); static final byte TYPE_RUN; static final byte TYPE_BRANCH_VALUE; static final byte TYPE_ALT_BRANCH; static final byte TYPE_SWITCH_BRANCH; static final byte TYPE_VALUE_NUMERIC; static final byte TYPE_VALUE_BYTES; static final byte TYPE_SAFE_END; static final byte TYPE_END; final byte ESCAPE_BYTE; final byte NO_ESCAPE_SUPPORT; static final byte ESCAPE_CMD_OPTIONAL_SIGNED_INT; static final byte ESCAPE_CMD_SIGNED_INT; static final byte ESCAPE_CMD_UNSIGNED_INT; static final byte ESCAPE_CMD_SIGNED_HEX; static final byte ESCAPE_CMD_UNSIGNED_HEX; static final byte ESCAPE_CMD_DECIMAL; static final byte ESCAPE_CMD_RATIONAL; static final byte ESCAPE_CMD_BYTES; final byte caseRuleMask; }
@Test public void testToString() { TrieParser map = new TrieParser(16); map.setValue(wrapping(data1, 3), 0, 3, 7, value2); map.setValue(wrapping(data1, 3), 0, 8, 7, value1); map.setValue(wrapping(data2, 3), 1, 7, 7, value1); map.setValue(wrapping(data3, 3), 1, 7, 7, value2); map.setValue(wrapping(data2b, 3), 1, 7, 7, value3); map.setValue(wrapping(data3b, 3), 1, 7, 7, value4); String actual = map.toString(); String expected = "BRANCH_VALUE1[0], 00000010[1], 0[2], 49[3], jumpTo:53\n"+ "RUN0[4], 3[5], 107'k'[6], 108'l'[7], 109'm'[8], \n"+ "BRANCH_VALUE1[9], 00000010[10], 0[11], 20[12], jumpTo:33\n"+ "RUN0[13], 2[14], 120'x'[15], 121'y'[16], \n"+ "BRANCH_VALUE1[17], 00000010[18], 0[19], 6[20], jumpTo:27\n"+ "RUN0[21], 2[22], 128[23], 129[24], \n"+ "END7[25], 47[26], \n"+ "RUN0[27], 2[28], 122'z'[29], 123'{'[30], \n"+ "END7[31], 23[32], \n"+ "RUN0[33], 2[34], 110'n'[35], 111'o'[36], \n"+ "BRANCH_VALUE1[37], 00000010[38], 0[39], 6[40], jumpTo:47\n"+ "RUN0[41], 2[42], 118'v'[43], 119'w'[44], \n"+ "END7[45], 35[46], \n"+ "RUN0[47], 2[48], 112'p'[49], 113'q'[50], \n"+ "END7[51], 10[52], \n"+ "RUN0[53], 3[54], 101'e'[55], 102'f'[56], 103'g'[57], \n"+ "SAFE6[58], 23[59], \n"+ "RUN0[60], 5[61], 104'h'[62], 105'i'[63], 106'j'[64], 107'k'[65], 108'l'[66], \n"+ "END7[67], 10[68], \n"; if (!expected.equals(actual)) { System.out.println("String expected = \"" + (actual.replace("\n", "\\n\"+\n\""))); } assertEquals(expected, actual); int actualLimit = map.getLimit(); assertEquals(69, actualLimit); }