List<Kunde> result = new ArrayList<Kunde>();
try {
// Check each customer ...
for (int i = 0; i < kunden.size(); i++) {
Kunde currentCustomer = kunden.get(i);
// Check for last name and customer number ...
if (isEqualCustomerName(getInSelection().getKundenname(),
currentCustomer)
&& isEqualCustomerNumber(getInSelection()
.getKundennummer(), currentCustomer)) {
result.add((Kunde) currentCustomer.clone());
// Check for last name ...
} else if (isEqualCustomerName(
getInSelection().getKundenname(), currentCustomer)
&& (getInSelection().getKundennummer() == null)) {
result.add((Kunde) currentCustomer.clone());
// Check for customer number ...
} else if (((getInSelection().getKundenname() == null) || (getInSelection()
.getKundenname().trim().equals("")))
&& isEqualCustomerNumber(getInSelection()
.getKundennummer(), currentCustomer)) {
result.add((Kunde) currentCustomer.clone());
}
}
KundenFindenActionSelectionOut out = new KundenFindenActionSelectionOut();
out.setKunden(result);