Paypal.java 909B

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