IngestUtilities { public static char getDelimiterByName(String delimiter) { if (delimiter == null || delimiter.equalsIgnoreCase("NULL")) { return '\0'; } else if (delimiter.equalsIgnoreCase("SPACE")) { return ' '; } else if (delimiter.equalsIgnoreCase("TAB")) { return '\t'; } else if (delimiter.equalsIgnoreCase("NEWLINE")) { return '\n'; } else { return delimiter.charAt(0); } } private  IngestUtilities(); static char getDelimiterByName(String delimiter); static String escapeDelimiter(char delimiter); static String removeUnprintableCharacters(String string); static long ipStringToLong(String ipString); static String ipLongToString(Long ipLong); static Integer unsignedByteToInt(Byte b); static Integer unsignedShortToInt(Short b); static long unsignedIntToLong(Integer i); static Level levelFromString(String level); static String removeQuotes(String inputString); static final String METADATA; static final String RECORD; }
@Test public void testGetDelimiterByName() throws Exception { assertThat(getDelimiterByName("space"), is(' ')); assertThat(getDelimiterByName("TAB"), is('\t')); assertThat(getDelimiterByName("\t"), is('\t')); assertThat(getDelimiterByName("Null"), is('\0')); assertThat(getDelimiterByName(","), is(',')); assertThat(getDelimiterByName("|"), is('|')); }