package gov.cms.grouper.snf.model.table;

import gov.cms.grouper.snf.Data.NtaComorbidityMaster;

public class NtaComorbidityMasterRow extends BasicRow {

  private String code;
  private String ntaCategory;

  private NtaComorbidityMasterRow() {}

  public NtaComorbidityMasterRow(String code, Integer lowVersion, Integer highVersion, String ntaCategory) {
    super(lowVersion, highVersion);
    this.code = code;
    this.ntaCategory = ntaCategory;
  }

  public static NtaComorbidityMasterRow build(NtaComorbidityMaster row) {
    return new NtaComorbidityMasterRow(row.getCode(), row.getLowVersion(), row.getHighVersion(),
        row.getComorbidity());
  }

  public String getCode() {
    return this.code;
  }

  public String getNtaCategory() {
    return this.ntaCategory;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = super.getHashCode(result, prime);
    result = prime * result + ((this.code == null) ? 0 : this.code.hashCode());
    result = prime * result + ((this.ntaCategory == null) ? 0 : this.ntaCategory.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (this.getClass() != obj.getClass()) {
      return false;
    }
    NtaComorbidityMasterRow other = (NtaComorbidityMasterRow) obj;
    if (!super.equals(other)) {
      return false;
    }
    if (this.code == null) {
      if (other.code != null) {
        return false;
      }
    } else if (!this.code.equals(other.code)) {
      return false;
    }
    if (this.ntaCategory == null) {
      if (other.ntaCategory != null) {
        return false;
      }
    } else if (!this.ntaCategory.equals(other.ntaCategory)) {
      return false;
    }
    return true;
  }
}
