【发布时间】:2017-10-23 16:17:47
【问题描述】:
在 Java 8 中,从列表列表中获取包含 Type1 元素的列表的最佳方法是 ->(记录){List<Type1>, List<Type2>, List<Type3>, ...} ?
Records 有多个不同类型的列表 -> {List<Type1>, List<Type2>, List<Type3>, ...}
List<T> getList(T t) {
// t is instance of Type1
return Records -> List<t>;
}
非常感谢您的帮助。
【问题讨论】:
-
Type1、Type2等是否相关?
-
不,这些类型完全相互独立。感谢您的评论。
标签: java lambda filter prediction