@Test public void processJustRightCols() throws BadDataException { final String code = "SPFT"; final String name = "Stay Puft Marshmallow Corporation"; final MfgData md = new MfgData(code, name); final RecordProcessor<MfgData> proc = new MfgRecordProcessor(); assertEquals(md, proc.process(new String[] { md.code, md.name })); }
public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); }
MfgRecordProcessor implements RecordProcessor<MfgData> { public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); } }
MfgRecordProcessor implements RecordProcessor<MfgData> { public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); }  }
MfgRecordProcessor implements RecordProcessor<MfgData> { public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); }  MfgData process(String[] col); }
MfgRecordProcessor implements RecordProcessor<MfgData> { public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); }  MfgData process(String[] col);  }