JAVA-27645 Check article code matches github (#15323)

This commit is contained in:
anuragkumawat
2023-12-01 12:14:25 -08:00
committed by GitHub
parent 6508331a74
commit 76a2939e7d
3 changed files with 30 additions and 30 deletions
@@ -14,52 +14,52 @@ import java.util.List;
public class Application {
// CSV Reader Examples
public static List<String[]> readLineByLineSyncExample() throws Exception {
public static List<String[]> readLineByLineExample() throws Exception {
Path path = Helpers.twoColumnCsvPath();
return CsvReaderExamples.readLineByLine(path);
}
public static List<String[]> readAllLinesSyncExample() throws Exception {
public static List<String[]> readAllLinesExample() throws Exception {
Path path = Helpers.twoColumnCsvPath();
return CsvReaderExamples.readAllLines(path);
}
// CSV Writer Examples
public static String writeLineByLineSyncExample() throws Exception {
public static String writeLineByLineExample() throws Exception {
Path path = Helpers.fileOutOnePath();
return CsvWriterExamples.writeLineByLine(Helpers.fourColumnCsvString(), path);
}
public static String writeAllLinesSyncExample() throws Exception {
public static String writeAllLinesExample() throws Exception {
Path path = Helpers.fileOutAllPath();
return CsvWriterExamples.writeAllLines(Helpers.fourColumnCsvString(), path);
}
// Bean Examples
public static List<CsvBean> simpleSyncPositionBeanExample() throws Exception {
public static List<CsvBean> simplePositionBeanExample() throws Exception {
Path path = Helpers.twoColumnCsvPath();
return BeanExamples.beanBuilderExample(path, SimplePositionBean.class);
}
public static List<CsvBean> namedSyncColumnBeanExample() throws Exception {
public static List<CsvBean> namedColumnBeanExample() throws Exception {
Path path = Helpers.namedColumnCsvPath();
return BeanExamples.beanBuilderExample(path, NamedColumnBean.class);
}
public static String writeSyncCsvFromBeanExample() throws Exception {
public static String writeCsvFromBeanExample() throws Exception {
Path path = Helpers.fileOutBeanPath();
return BeanExamples.writeCsvFromBean(path);
}
public static void main(String[] args) {
try {
simpleSyncPositionBeanExample();
namedSyncColumnBeanExample();
writeSyncCsvFromBeanExample();
readLineByLineSyncExample();
readAllLinesSyncExample();
writeLineByLineSyncExample();
writeAllLinesSyncExample();
simplePositionBeanExample();
namedColumnBeanExample();
writeCsvFromBeanExample();
readLineByLineExample();
readAllLinesExample();
writeLineByLineExample();
writeAllLinesExample();
} catch (Exception e) {
throw new RuntimeException("Error during csv processing", e);
}