mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-19 19:26:36 +00:00
feature: added code refactoring changes for 2378 (#2379)
* fix:added code refactoring changes for 2378 * fix:added code refactoring changes for 2378 * build fix for 2378 * fix: updated pom.xml files for 2378 issue * fix:build fix for 2378 issue Co-authored-by: aparna <aparna@aparnas-MacBook-Air.local>
This commit is contained in:
@@ -27,7 +27,6 @@ package com.iluwatar.converter;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
@@ -74,7 +73,7 @@ public class Converter<T, U> {
|
||||
* with the conversion function
|
||||
*/
|
||||
public final List<U> createFromDtos(final Collection<T> dtos) {
|
||||
return dtos.stream().map(this::convertFromDto).collect(Collectors.toList());
|
||||
return dtos.stream().map(this::convertFromDto).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +84,7 @@ public class Converter<T, U> {
|
||||
* with the conversion function
|
||||
*/
|
||||
public final List<T> createFromEntities(final Collection<U> entities) {
|
||||
return entities.stream().map(this::convertFromEntity).collect(Collectors.toList());
|
||||
return entities.stream().map(this::convertFromEntity).toList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user