@Test(expected=BadDataException.class) public void processTooManyCols() throws BadDataException { final RecordProcessor<OSData> proc = new OSRecordProcessor(); proc.process(new String[] { "foo", "foo", "foo", "foo", "foo" }); }
public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); }
OSRecordProcessor implements RecordProcessor<OSData> { public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); } }
OSRecordProcessor implements RecordProcessor<OSData> { public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); }  }
OSRecordProcessor implements RecordProcessor<OSData> { public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); }  OSData process(String[] col); }
OSRecordProcessor implements RecordProcessor<OSData> { public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); }  OSData process(String[] col);  }