PayPal.java 1015B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.zipcoder.payment;
  2. public class PayPal implements Payment {
  3. private long id;
  4. private String payerName;
  5. private String email;
  6. public PayPal(){};
  7. public PayPal(long id, String payerName, String email){
  8. this.id = id;
  9. this.payerName = payerName;
  10. this.email = email;
  11. }
  12. public Long getId() {
  13. return this.id;
  14. }
  15. public void setId(long id) {
  16. this.id = id;
  17. }
  18. public String getPayerName() {
  19. return this.payerName;
  20. }
  21. public void setPayerName(String payerName) {
  22. this.payerName = payerName;
  23. }
  24. public String getEmail() {
  25. return this.email;
  26. }
  27. public void setEmail(String email) {
  28. this.email = email;
  29. }
  30. public String getShortDescription() {
  31. return "PayPal" + " " + getPayerName() + " " + getEmail();
  32. }
  33. public int compareTo(Payment o) {
  34. int n = this.getShortDescription().compareTo(o.getShortDescription());
  35. return n;
  36. }
  37. }