We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * 把 sourceList 的一些属性合并到 targetList 中 * 基于 testFunction 的条件,合入逻辑实现为 biConsumer * @param targetList * @param sourceList * @param testFunction * @param biConsumer * @param <T> * @param <S> */ public static <T, S> void merge(List<T> targetList, List<S> sourceList, BiFunction<? super T, ? super S,Boolean> testFunction, BiConsumer<? super T, ? super S> biConsumer) { targetList.forEach((t)->{ Optional<S> optional = sourceList.stream().filter(s -> testFunction.apply(t,s)).findFirst(); if (optional.isPresent()) { biConsumer.accept(t,optional.get()); } }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: