ColumnInfoToStringEncoderDecoder { public static List<ColumnInfo> decode(final String columnInfoStr) { Preconditions.checkNotNull(columnInfoStr); List<ColumnInfo> columnInfos = Lists.newArrayList( Iterables.transform( Splitter.on(COLUMN_INFO_DELIMITER).omitEmptyStrings().split(columnInfoStr), new Function<String, ColumnInfo>() { @Override public ColumnInfo apply(String colInfo) { return ColumnInfo.fromString(colInfo); } })); return columnInfos; } private  ColumnInfoToStringEncoderDecoder(); static String encode(List<ColumnInfo> columnInfos); static List<ColumnInfo> decode(final String columnInfoStr);  }
@Test public void testDecode() { final ColumnInfo columnInfo = new ColumnInfo("col1", PVarchar.INSTANCE.getSqlType()); final String encodedColumnInfo = ColumnInfoToStringEncoderDecoder.encode(Lists.newArrayList(columnInfo)); assertEquals(columnInfo.toString(),encodedColumnInfo); }