Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一些可迭代变量v和类型T,我经常发现自己在编写代码,例如
v
T
v.filter[it instanceof T].map[it as T]
是否存在一些在单个步骤中执行相同功能的助手?
您可能想要使用v.filter(T)(或遗留语法v.filter(typeof(T))),它是 Xtend 的 Java 等效语法v.filter(T.class)。
v.filter(T)
v.filter(typeof(T))
v.filter(T.class)