Payer.java 443B

1234567891011121314151617181920
  1. package com.zipcoder.Comparators;
  2. import com.zipcoder.payment.Payment;
  3. import java.util.Comparator;
  4. public class Payer implements Comparator<Payment> {
  5. public int compare(Payment o1, Payment o2) {
  6. if(o1.getPayerName().compareTo(o2.getPayerName()) > 0){
  7. return 1;
  8. } else if(o1.getPayerName().compareTo(o2.getPayerName()) < 0){
  9. return -1;
  10. } else {
  11. return 0;
  12. }
  13. }
  14. }