class TableMetadata {

  @JsonProperty("columnMetadata")
  private final List<ColumnMetadata> columnMetadataList = new ArrayList<>();

  // The name of the table
  private String name;

  // The number of rows in the table
  private int rowCount;

  @JsonIgnore private Map<String, ColumnMetadata> columnMetadataMap = new HashMap<>();

  TableMetadata(Relation table) {
    this.name = table.name();
    this.rowCount = table.rowCount();

    for (Column<?> column : table.columns()) {
      ColumnMetadata metadata = new ColumnMetadata(column);
      columnMetadataList.add(metadata);
      columnMetadataMap.put(column.name(), metadata);
    }
  }

  /** Default constructor for Jackson json serialization */
  protected TableMetadata() {}

  @Override
  public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

  @Override
  public int hashCode() {
    return Objects.hashCode(getColumnMetadataList(), getName(), getRowCount());
  }

  /** Returns the name of the table */
  @SuppressWarnings("WeakerAccess")
  public String getName() {
    return name;
  }

  /** Returns the number of rows in the table */
  @SuppressWarnings("WeakerAccess")
  public int getRowCount() {
    return rowCount;
  }

  /** Returns a list of ColumnMetadata objects, one for each Column in the table */
  List<ColumnMetadata> getColumnMetadataList() {
    return columnMetadataList;
  }

  public Map<String, ColumnMetadata> getColumnMetadataMap() {
    return columnMetadataMap;
  }

  /** Returns the number of columns in the table */
  public int columnCount() {
    return getColumnMetadataList().size();
  }

  /**
   * Returns a string describing the number of rows and columns in the table. This is analogous to
   * the shape() method defined on Relation.
   */
  public String shape() {
    return getName() + ": " + getRowCount() + " rows X " + columnCount() + " cols";
  }

  /** Returns a List of the names of all the columns in this table */
  public List<String> columnNames() {
    return columnMetadataList.stream().map(ColumnMetadata::getName).collect(toList());
  }

  /** Returns a table that describes the columns in this table */
  public Table structure() {
    Table t = Table.create("Structure of " + getName());
    IntColumn index = IntColumn.indexColumn("Index", columnCount(), 0);
    StringColumn columnName = StringColumn.create("Column Name", columnCount());
    StringColumn columnType = StringColumn.create("Column Type", columnCount());
    t.addColumns(index);
    t.addColumns(columnName);
    t.addColumns(columnType);
    for (int i = 0; i < columnCount(); i++) {
      ColumnMetadata column = columnMetadataList.get(i);
      columnType.set(i, column.getType());
      columnName.set(i, columnNames().get(i));
    }
    return t;
  }
}

    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    TableMetadata metadata = (TableMetadata) o;
    return getRowCount() == metadata.getRowCount()
        && Objects.equal(getColumnMetadataList(), metadata.getColumnMetadataList())
        && Objects.equal(getName(), metadata.getName());
  
<no_super_class>