@Override public void apply(Customer customer, Properties properties) { Integer year = Integer.parseInt(properties.getProperty("taxYear")); String taxCreditCode = properties.getProperty("taxCreditCode"); CustomerTaxRecord taxRecord = taxRecords.forCustomer(customer); TaxYear taxYear = TaxYear.lookup(year, container); CustomerTaxYear customerTaxYear = taxRecord.taxYearFor(year); TaxCreditType taxCreditType = TaxCreditType.lookup(taxCreditCode, container); TaxCreditRate taxCreditRate = TaxCreditRate.lookup(taxYear, taxCreditType, container); customerTaxYear.claimTaxCredit(taxCreditRate); }
@Override public int compare(CustomerTaxYear cty1, CustomerTaxYear cty2) { return -(cty1.getTaxYear().compareTo(cty2.getTaxYear())); }
// {{ Comparable (impl), MostRecentFirstComparator @Ignore @Override public int compareTo(CustomerTaxYear o) { return getTaxYear().compareTo(o.getTaxYear()); }