假设我在 IMap 中有以下值:
public class Employee{
public int empId;
public List<String> categories;
public List<String> getCategories(){
return this.categories;
}
}
我想找到属于“销售”类别的所有员工。另外,我想在 getCategories() 上创建一个索引,以便查询快速返回。似乎没有可用的谓词来执行此操作。我该如何实现这一目标?看来我将不得不写一个谓词来做到这一点。是否有可以查看的示例代码向我展示如何构建使用索引的谓词?