| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package com.zipcoder.payment;
-
- public class Paypal implements Payment {
- private long id;
- private String payerName;
- private String email;
- public Paypal(int id,String payerName,String email)
- {
- this.id=id;
- this.payerName=payerName;
- this.email=email;
- }
-
- public long getId()
- {
- return this.id;
- }
- public void setId(Long id)
- {
- this.id=id;
- }
- public String getPayerName()
- {
- return this.payerName;
- }
- public void setPayerName(String name)
- {
- this.payerName=name;
- }
- public String getemail()
- {
- return this.email;
- }
- public void setemail(String email)
- {
- this.email=email;
- }
- public String getShortDescription()
- {
- // String number=getNumber();
- StringBuilder br =new StringBuilder();
- br.append("Paypal").append(" ").append(getPayerName()).append(" ")
- .append(getemail());
- System.out.println(br.toString());
- return br.toString();
- }
-
- public int compareTo(Payment o) {
- int number=0;
-
- if(this.getShortDescription().compareTo(o.getShortDescription())==0)
- {
- number=0;
- }
- if(this.getShortDescription().compareTo(o.getShortDescription())<0)
- {
- number=-1;
- }
- if(this.getShortDescription().compareTo(o.getShortDescription())>0)
- {
- number=1;
- }
- return number;
- }
- }
|