Skip to content

Commit

Permalink
fix(Name Field): Only printing out the generated name field notice on…
Browse files Browse the repository at this point in the history
…ce (#311)
  • Loading branch information
ndickerson authored Apr 22, 2020
1 parent 382db3d commit dfb211e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/java/com/bullhorn/dataloader/rest/Preloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class Preloader {
private final RestSession restSession;
private Map<String, Integer> countryNameToIdMap = null;
private final PrintUtil printUtil;
private Boolean nameFieldNotificationLogged = false;

public Preloader(RestSession restSession, PrintUtil printUtil) {
this.restSession = restSession;
Expand Down Expand Up @@ -96,9 +97,14 @@ private Map<String, Integer> createCountryNameToIdMap() {
private void checkAndAddNameCell(Row row) {
if (row.hasValue(StringConsts.FIRST_NAME) && row.hasValue(StringConsts.LAST_NAME) && !row.hasValue(StringConsts.NAME)) {
row.addCell(new Cell(StringConsts.NAME, row.getValue(StringConsts.FIRST_NAME) + ' ' + row.getValue(StringConsts.LAST_NAME)));
printUtil.printAndLog("Added " + StringConsts.NAME + " field as " + "'<" + StringConsts.FIRST_NAME + "> <" + StringConsts.LAST_NAME + ">'"
+ " since both " + StringConsts.FIRST_NAME + " and " + StringConsts.LAST_NAME + " were provided but "
+ StringConsts.NAME + " was not.");

if (!nameFieldNotificationLogged) {
printUtil.printAndLog("Added " + StringConsts.NAME
+ " field as " + "'<" + StringConsts.FIRST_NAME + "> <" + StringConsts.LAST_NAME + ">'"
+ " since both " + StringConsts.FIRST_NAME + " and " + StringConsts.LAST_NAME + " were provided but "
+ StringConsts.NAME + " was not.");
nameFieldNotificationLogged = true;
}
}
}
}

0 comments on commit dfb211e

Please sign in to comment.