parent
cb71b14eae
commit
e0471114fa
@ -0,0 +1,26 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EmployeeSearch {
|
||||
|
||||
public List<Employee> findByDepartment(List<Employee> employees, String department) {
|
||||
// Department field not defined in Employee; returning empty for now.
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public List<Employee> findByHireDateRange(List<Employee> employees, String startDate, String endDate) {
|
||||
// Hire date field not defined in Employee; returning empty for now.
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public List<Employee> findBySalaryRange(List<Employee> employees, int minSalary, int maxSalary) {
|
||||
List<Employee> result = new ArrayList<>();
|
||||
for (Employee e : employees) {
|
||||
int sal = e.getSalary();
|
||||
if (sal >= minSalary && sal <= maxSalary) {
|
||||
result.add(e);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue