আমি Listএর Employeeবিভিন্ন যোগদান তারিখ দিয়ে গুলি। আমি স্ট্রিম ব্যবহার করে তালিকা থেকে যোগদানের নির্দিষ্ট তারিখের আগে এবং পরে কর্মচারী পেতে চাই।
আমি কোড অনুসরণ করার চেষ্টা করেছি,
List<Employee> employeeListAfter = employeeList.stream()
.filter(e -> e.joiningDate.isAfter(specificDate))
.collect(Collectors.toList());
List<Employee> employeeListBefore = employeeList.stream()
.filter(e -> e.joiningDate.isBefore(specificDate))
.collect(Collectors.toList());
class Employee{
int id;
String name;
LocalDate joiningDate;
}
একক স্ট্রিমে এটি করার কোনও উপায় আছে কি?
partitioningBy