public class Paypal implements Payment { private long id; private String payerName; private String email; public Paypal(){ } public Paypal(long id, String payerName, String email){ this.id = id; this.payerName = payerName; this.email= email; } public long getId() { return id; } public String getPayerName() { return payerName; } public String getShortDescription() { return "Paypal " + getPayerName() + " " + getEmail(); } public void setId(long id) { this.id = id; } public void setPayerName(String payerName) { this.payerName = payerName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public int compareTo(Payment o) { if (this.getShortDescription().compareTo(o.getShortDescription()) > 0) return 1; else if (this.getShortDescription().compareTo(o.getShortDescription()) < 0)return -1; else return 0; } }