formatting changes
This commit is contained in:
parent
9a6688f638
commit
35db28ccfb
|
@ -21,7 +21,6 @@ public class Application {
|
||||||
EmployeeInput ui = new EmployeeConsoleInputImpl();
|
EmployeeInput ui = new EmployeeConsoleInputImpl();
|
||||||
ui.collectData(service);
|
ui.collectData(service);
|
||||||
service.generateOutput();
|
service.generateOutput();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.baeldung.hexagonal.domain;
|
package com.baeldung.hexagonal.domain;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.baeldung.hexagonal.output.EmployeeOutput;
|
import com.baeldung.hexagonal.output.EmployeeOutput;
|
||||||
|
|
|
@ -20,7 +20,9 @@ public class EmployeeCsvWriter implements EmployeeOutput {
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println(path);
|
System.out.println(path);
|
||||||
if (!path.endsWith("/")) path += "/";
|
if (!path.endsWith("/")) {
|
||||||
|
path += "/";
|
||||||
|
}
|
||||||
|
|
||||||
outputFile = new File(path, fileName);
|
outputFile = new File(path, fileName);
|
||||||
}
|
}
|
||||||
|
@ -48,13 +50,13 @@ public class EmployeeCsvWriter implements EmployeeOutput {
|
||||||
}
|
}
|
||||||
writer.flush();
|
writer.flush();
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
//handle the exception
|
// handle the exception
|
||||||
} finally {
|
} finally {
|
||||||
if (writer != null) {
|
if (writer != null) {
|
||||||
try {
|
try {
|
||||||
writer.close();
|
writer.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//handle the exception
|
// handle the exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.baeldung.hexagonal.domain.Employee;
|
||||||
|
|
||||||
public interface EmployeeRepository {
|
public interface EmployeeRepository {
|
||||||
public Long save(Employee employee);
|
public Long save(Employee employee);
|
||||||
|
|
||||||
public Employee findById(Long id);
|
public Employee findById(Long id);
|
||||||
|
|
||||||
public List<Employee> findAll();
|
public List<Employee> findAll();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class EmployeeConsoleInputImpl implements EmployeeInput {
|
||||||
LOG.info("Employee ID: ");
|
LOG.info("Employee ID: ");
|
||||||
System.out.print("> ");
|
System.out.print("> ");
|
||||||
String employeeId = scanner.next();
|
String employeeId = scanner.next();
|
||||||
LOG.info("Salary: " );
|
LOG.info("Salary: ");
|
||||||
System.out.print("> ");
|
System.out.print("> ");
|
||||||
BigDecimal salary = scanner.nextBigDecimal();
|
BigDecimal salary = scanner.nextBigDecimal();
|
||||||
|
|
||||||
|
@ -45,7 +45,8 @@ public class EmployeeConsoleInputImpl implements EmployeeInput {
|
||||||
LOG.info("Do you want to enter another employee? (Y/N)");
|
LOG.info("Do you want to enter another employee? (Y/N)");
|
||||||
System.out.print("> ");
|
System.out.print("> ");
|
||||||
keepGoing = scanner.next();
|
keepGoing = scanner.next();
|
||||||
if (keepGoing.length() > 1) keepGoing = keepGoing.substring(0, 1);
|
if (keepGoing.length() > 1)
|
||||||
|
keepGoing = keepGoing.substring(0, 1);
|
||||||
} while (keepGoing.equalsIgnoreCase("Y"));
|
} while (keepGoing.equalsIgnoreCase("Y"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue