@Test public void testConvertRecord() throws DataConversionException { WorkUnitState workUnitState = new WorkUnitState(); ObjectToStringConverter converter = new ObjectToStringConverter(); converter.init(workUnitState); Integer integerValue = new Integer(1); Iterator<String> itr = converter.convertRecord(String.class, integerValue, workUnitState).iterator(); Assert.assertTrue(itr.hasNext()); Assert.assertEquals(itr.next(), "1"); Assert.assertTrue(!itr.hasNext()); Long longValue = new Long(2); itr = converter.convertRecord(String.class, longValue, workUnitState).iterator(); Assert.assertTrue(itr.hasNext()); Assert.assertEquals(itr.next(), "2"); Assert.assertTrue(!itr.hasNext()); }
@Override public Iterable<String> convertRecord(Class<String> outputSchema, Object inputRecord, WorkUnitState workUnit) throws DataConversionException { return new SingleRecordIterable<>(inputRecord.toString()); }
ObjectToStringConverter extends Converter<Object, Class<String>, Object, String> { @Override public Iterable<String> convertRecord(Class<String> outputSchema, Object inputRecord, WorkUnitState workUnit) throws DataConversionException { return new SingleRecordIterable<>(inputRecord.toString()); } }
ObjectToStringConverter extends Converter<Object, Class<String>, Object, String> { @Override public Iterable<String> convertRecord(Class<String> outputSchema, Object inputRecord, WorkUnitState workUnit) throws DataConversionException { return new SingleRecordIterable<>(inputRecord.toString()); }  }
ObjectToStringConverter extends Converter<Object, Class<String>, Object, String> { @Override public Iterable<String> convertRecord(Class<String> outputSchema, Object inputRecord, WorkUnitState workUnit) throws DataConversionException { return new SingleRecordIterable<>(inputRecord.toString()); }  @Override Class<String> convertSchema(Object inputSchema, WorkUnitState workUnit); @Override Iterable<String> convertRecord(Class<String> outputSchema, Object inputRecord, WorkUnitState workUnit); }
ObjectToStringConverter extends Converter<Object, Class<String>, Object, String> { @Override public Iterable<String> convertRecord(Class<String> outputSchema, Object inputRecord, WorkUnitState workUnit) throws DataConversionException { return new SingleRecordIterable<>(inputRecord.toString()); }  @Override Class<String> convertSchema(Object inputSchema, WorkUnitState workUnit); @Override Iterable<String> convertRecord(Class<String> outputSchema, Object inputRecord, WorkUnitState workUnit);  }