public int compareTo(FailedStatus other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; FailedStatus typedOther = (FailedStatus) other; lastComparison = Boolean.valueOf(is_set_error_message()).compareTo(typedOther.is_set_error_message()); if (lastComparison != 0) { return lastComparison; } if (is_set_error_message()) { lastComparison = TBaseHelper.compareTo(this.error_message, typedOther.error_message); if (lastComparison != 0) { return lastComparison; } } return 0; }