list获取不重复的元素字段 @param list 源数据 @param classifier 去重字段 @return 去重字段set
(List<S> list,Function<? super S, ? extends T> classifier)
| 677 | * @return 去重字段set |
| 678 | */ |
| 679 | public static <T, S> Set<T> distinctListParam(List<S> list,Function<? super S, ? extends T> classifier){ |
| 680 | |
| 681 | Set<T> set = new LinkedHashSet<T>(); |
| 682 | for(S s:list) { |
| 683 | set.add(classifier.apply(s)); |
| 684 | } |
| 685 | |
| 686 | return set; |
| 687 | } |
| 688 | } |
| 689 | |
| 690 |
nothing calls this directly
no outgoing calls
no test coverage detected