public boolean equals(final Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    final ReportStateKey that = (ReportStateKey) o;

    if (restoreState != that.restoreState) {
      return false;
    }
    if (cursor != that.cursor) {
      return false;
    }
    if (groupLevel != that.groupLevel) {
      return false;
    }
    if (stateCode != that.stateCode) {
      return false;
    }
    if (subreport != that.subreport) {
      return false;
    }
    if (parent != null ? !parent.equals(that.parent) : that.parent != null) {
      return false;
    }
    return true;
  }