I have 2 tax implementation classes IndianTaxCalculation
and USTAxCalculation
which have implementaions for calculateTax()
method. I need
Try something like this:
@Autowired
@Qualifier("indian")
private TaxCalculation indianTax;
@Autowired
@Qualifier("us")
private TaxCalculation usTax;
public void calculateTaxes(Client client) {
if (client.isFromIndia()) {
indiaTax.calculate(client);
} else if (client.isFromUS()) {
usTax.calculate(client);
}
}