public int compareTo(DateTime aThat) {
    if (this == aThat) return EQUAL;
    ensureParsed();
    aThat.ensureParsed();

    ModelUtil.NullsGo nullsGo = ModelUtil.NullsGo.FIRST;
    int comparison = ModelUtil.comparePossiblyNull(this.fYear, aThat.fYear, nullsGo);
    if (comparison != EQUAL)  return comparison;

    comparison = ModelUtil.comparePossiblyNull(this.fMonth, aThat.fMonth, nullsGo);
    if (comparison != EQUAL)  return comparison;

    comparison = ModelUtil.comparePossiblyNull(this.fDay, aThat.fDay, nullsGo);
    if (comparison != EQUAL)  return comparison;

    comparison = ModelUtil.comparePossiblyNull(this.fHour, aThat.fHour, nullsGo);
    if (comparison != EQUAL)  return comparison;

    comparison = ModelUtil.comparePossiblyNull(this.fMinute, aThat.fMinute, nullsGo);
    if (comparison != EQUAL)  return comparison;

    comparison = ModelUtil.comparePossiblyNull(this.fSecond, aThat.fSecond, nullsGo);
    if (comparison != EQUAL)  return comparison;

    comparison = ModelUtil.comparePossiblyNull(this.fNanosecond, aThat.fNanosecond, nullsGo);
    if (comparison != EQUAL)  return comparison;

    return EQUAL;
  }