public int compareTo(NoteAttributes other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    NoteAttributes typedOther = (NoteAttributes) other;

    lastComparison = Boolean.valueOf(isSetSubjectDate()).compareTo(typedOther.isSetSubjectDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSubjectDate()) {
      lastComparison = TBaseHelper.compareTo(this.subjectDate, typedOther.subjectDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLatitude()).compareTo(typedOther.isSetLatitude());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLatitude()) {
      lastComparison = TBaseHelper.compareTo(this.latitude, typedOther.latitude);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLongitude()).compareTo(typedOther.isSetLongitude());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLongitude()) {
      lastComparison = TBaseHelper.compareTo(this.longitude, typedOther.longitude);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAltitude()).compareTo(typedOther.isSetAltitude());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAltitude()) {
      lastComparison = TBaseHelper.compareTo(this.altitude, typedOther.altitude);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAuthor()).compareTo(typedOther.isSetAuthor());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAuthor()) {
      lastComparison = TBaseHelper.compareTo(this.author, typedOther.author);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSource()).compareTo(typedOther.isSetSource());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSource()) {
      lastComparison = TBaseHelper.compareTo(this.source, typedOther.source);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSourceURL()).compareTo(typedOther.isSetSourceURL());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSourceURL()) {
      lastComparison = TBaseHelper.compareTo(this.sourceURL, typedOther.sourceURL);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetSourceApplication()).compareTo(typedOther.isSetSourceApplication());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSourceApplication()) {
      lastComparison = TBaseHelper.compareTo(this.sourceApplication, typedOther.sourceApplication);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetShareDate()).compareTo(typedOther.isSetShareDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetShareDate()) {
      lastComparison = TBaseHelper.compareTo(this.shareDate, typedOther.shareDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPlaceName()).compareTo(typedOther.isSetPlaceName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPlaceName()) {
      lastComparison = TBaseHelper.compareTo(this.placeName, typedOther.placeName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetContentClass()).compareTo(typedOther.isSetContentClass());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContentClass()) {
      lastComparison = TBaseHelper.compareTo(this.contentClass, typedOther.contentClass);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetApplicationData()).compareTo(typedOther.isSetApplicationData());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetApplicationData()) {
      lastComparison = TBaseHelper.compareTo(this.applicationData, typedOther.applicationData);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastEditedBy()).compareTo(typedOther.isSetLastEditedBy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastEditedBy()) {
      lastComparison = TBaseHelper.compareTo(this.lastEditedBy, typedOther.lastEditedBy);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetClassifications()).compareTo(typedOther.isSetClassifications());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClassifications()) {
      lastComparison = TBaseHelper.compareTo(this.classifications, typedOther.classifications);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }