TableDesc implements ProtoObject<TableDescProto>, GsonObject, Cloneable { public TableDescProto getProto() { TableDescProto.Builder builder = TableDescProto.newBuilder(); if (this.tableName != null) { builder.setTableName(this.tableName); } if (this.schema != null) { builder.setSchema(schema.getProto()); } if (this.meta != null) { builder.setMeta(meta.getProto()); } if (this.uri != null) { builder.setPath(this.uri.toString()); } if (this.stats != null) { builder.setStats(this.stats.getProto()); } if (this.partitionMethodDesc != null) { builder.setPartition(this.partitionMethodDesc.getProto()); } if (this.external != null) { builder.setIsExternal(external); } return builder.build(); } TableDesc();  TableDesc(String tableName, Schema schema, TableMeta meta,
                   URI uri, boolean external);  TableDesc(String tableName, Schema schema, TableMeta meta, URI path);  TableDesc(String tableName, Schema schema, String storeType, KeyValueSet options, URI path);  TableDesc(TableDescProto proto); void setName(String tableId); String getName(); void setPath(URI uri); URI getPath(); void setMeta(TableMeta info); TableMeta getMeta(); void setSchema(Schema schem); Schema getSchema(); Schema getLogicalSchema(); void setStats(TableStats stats); boolean hasStats(); TableStats getStats(); boolean hasPartition(); PartitionMethodDesc getPartitionMethod(); void setPartitionMethod(PartitionMethodDesc partitionMethodDesc); void setExternal(boolean external); boolean isExternal(); int hashCode(); boolean equals(Object object); Object clone(); String toString(); String toJson(); TableDescProto getProto();  }
@Test public void testGetProto() throws CloneNotSupportedException, IOException { Path path = new Path(CommonTestingUtil.getTestDir(), "tajo"); TableDesc desc = new TableDesc("table1", schema, info, path.toUri()); desc.setStats(stats); CatalogProtos.TableDescProto proto = desc.getProto(); TableDesc fromProto = new TableDesc(proto); assertEquals("equality check the object deserialized from json", desc, fromProto); }