| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package com.zipcoder.payment;
-
- public class Check implements Payment {
-
- Long id;
- String payerName;
- String routingName;
- String accountNumber;
-
- public Check(){}
-
- public Check(Long id, String payerName, String routingName, String accountNumber){
- this.id = id;
- this.payerName = payerName;
- this.routingName = routingName;
- this.accountNumber = accountNumber;
- }
-
- public Check(String payerName, String accountNumber){
- this.payerName = payerName;
- this.accountNumber = accountNumber;
- }
-
- public Long getID() {
- return id;
- }
-
- public void setID(Long id) {
- this.id = id;
- }
-
- public String getPayerName() {
- return payerName;
- }
-
- public void setPayerName(String payerName){
- this.payerName = payerName;
- }
-
- public String getRoutingName() {
- return routingName;
- }
-
- public void setRoutingName(String routingName) {
- this.routingName = routingName;
- }
-
- public String getAccountNumber() {
- return accountNumber;
- }
-
- public void setAccountNumber(String accountNumber) {
- this.accountNumber = accountNumber;
- }
-
- public String getShortDescription() {
- return ("Check " + getPayerName() + " ***" + getLastFourDigits());
- }
-
- public String getLastFourDigits(){
- String lastFour = accountNumber.substring(accountNumber.length()-4);
- return lastFour;
- }
-
- public int compareTo(Payment o) {
- return this.getShortDescription().compareTo(o.getShortDescription());
- }
- }
|