* #496 Add pipeline module to parent pom ✨ * #496: Add main application class and test for pipeline * #496: Checkstyle format and add log messages on pipeline stages 🎨 * #496: Fill readme sections of pipeline ✨ * #496: Javadocs and checkstyle formatting 🎨 * #496: Follow PMD checks and add more explanation as block comment on App.java * #496: Apply requested PR changes by iluwatar 🎨 * #970: Replace log4j usage on commander pattern to Slf4j API 🎨 * #970: Replace log4j usage on dao pattern to Slf4j API 🎨 * #970: Replace log4j usage on data mapper pattern to Slf4j API 🎨 * #970: Remove log4j dependency on data transfer object pom 🔥 * #970: Replace log4j usage on module pattern to Slf4j API 🎨 * #970: Replace log4j usage on serverless pattern to Slf4j API 🎨 This also removes the aws log4j dependency * #970: Remove unnecessary gitignore line for log4j.xml 🔥 * #970: Remove remaining remnants of log4j 🔥 * #970: Replace System.out logging with appropriate logging methods 🎨 * #970: Replace System.out method references to Logger::info 🎨
This commit is contained in:
committed by
Ilkka Seppälä
parent
72b174619f
commit
cfdfedbd2e
@ -24,6 +24,8 @@ package com.iluwatar.converter;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -35,6 +37,8 @@ import java.util.List;
|
||||
* objects between types.
|
||||
*/
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
/**
|
||||
* Program entry point
|
||||
*
|
||||
@ -45,16 +49,16 @@ public class App {
|
||||
|
||||
UserDto dtoUser = new UserDto("John", "Doe", true, "whatever[at]wherever.com");
|
||||
User user = userConverter.convertFromDto(dtoUser);
|
||||
System.out.println("Entity converted from DTO:" + user);
|
||||
LOGGER.info("Entity converted from DTO:" + user);
|
||||
|
||||
ArrayList<User> users = Lists.newArrayList(new User("Camile", "Tough", false, "124sad"),
|
||||
new User("Marti", "Luther", true, "42309fd"), new User("Kate", "Smith", true, "if0243"));
|
||||
System.out.println("Domain entities:");
|
||||
users.forEach(System.out::println);
|
||||
LOGGER.info("Domain entities:");
|
||||
users.stream().map(User::toString).forEach(LOGGER::info);
|
||||
|
||||
System.out.println("DTO entities converted from domain:");
|
||||
LOGGER.info("DTO entities converted from domain:");
|
||||
List<UserDto> dtoEntities = userConverter.createFromEntities(users);
|
||||
dtoEntities.forEach(System.out::println);
|
||||
dtoEntities.stream().map(UserDto::toString).forEach(LOGGER::info);
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user