Schema implements ProtoObject<SchemaProto>, Cloneable, GsonObject { @Override public SchemaProto getProto() { SchemaProto.Builder builder = SchemaProto.newBuilder(); SchemaProtoBuilder recursiveBuilder = new SchemaProtoBuilder(builder); SchemaUtil.visitSchema(this, recursiveBuilder); return builder.build(); } Schema();  Schema(SchemaProto proto);  Schema(Schema schema);  Schema(Column [] columns);  Schema(Iterable<Column> columns); void setQualifier(String qualifier); int size(); Column getColumn(int id); Column getColumn(Column column); int getIndex(Column column); Column getColumn(String name); int getColumnId(String name); int getColumnIdByName(String colName); List<Column> getRootColumns(); List<Column> getAllColumns(); boolean contains(String name); boolean contains(Column column); boolean containsByQualifiedName(String qualifiedName); boolean containsByName(String colName); boolean containsAll(Collection<Column> columns); synchronized Schema addColumn(String name, TypeDesc typeDesc); synchronized Schema addColumn(String name, Type type); synchronized Schema addColumn(String name, Type type, int length); synchronized Schema addColumn(String name, DataType dataType); synchronized void addColumn(Column column); synchronized void addColumns(Schema schema); @Override int hashCode(); @Override boolean equals(Object o); @Override Object clone(); @Override SchemaProto getProto(); String toString(); @Override String toJson(); Column [] toArray();  }
@Test public final void testSchemaSchemaProto() { Schema schema2 = new Schema(schema.getProto()); assertEquals(schema, schema2); }
@Test public final void testGetProto() { SchemaProto proto = schema.getProto(); assertEquals("name", proto.getFields(0).getName()); assertEquals("age", proto.getFields(1).getName()); assertEquals("addr", proto.getFields(2).getName()); }
@Test public final void testProto() { Schema schema2 = new Schema(schema.getProto()); SchemaProto proto = schema2.getProto(); Schema fromJson = new Schema(proto); assertEquals(schema2, fromJson); }