EmailRecordComparator¶
-
public class
EmailRecordComparatorimplements Comparator<EmailRecord>¶ The
EmailRecordComparatorclass is an implementation of the Comparator interface, that allows callers to compareorg.motechproject.email.domain.EmailRecordobjects by a single field.
Constructors¶
EmailRecordComparator¶
-
public
EmailRecordComparator(Boolean ascending, String compareField)¶ Creates a new
EmailRecordComparatorthat supports comparison based on the specified field.Parameters: - ascending – boolean indicating whether comparisons should be ascending or descending
- compareField – the field for which comparisons should be performed
Methods¶
compare¶
-
public int
compare(EmailRecord o1, EmailRecord o2)¶ Compares its two arguments for order. If ascending is
true, returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. If ascending isfalse, returns a positive integer, zero, or negative integer as the first argument is less than, equal to, or greater than the second.Parameters: - o1 – the first
EmailRecordto be compared - o2 – the second
EmailRecordto be compared
Returns: a positive integer, zero, or negative integer indicating the result of comparing the objects
- o1 – the first