Skip to content

Commit

Permalink
miscellaneous updates
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-kan committed Aug 5, 2023
1 parent 432e675 commit 65d83cf
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/main/java/a_enterprise_business_rules/entities/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ public boolean equals(Object o) {
return allAttributesAreEqual;
}

/**
*
* @param taskID
* @param listOfTasks
* @return
*/
public static Task IDToTask(UUID taskID, ArrayList<Task> listOfTasks) {
int i = 0;
boolean taskFound = false;
Expand All @@ -213,4 +219,6 @@ public static Task IDToTask(UUID taskID, ArrayList<Task> listOfTasks) {
}
return task;
}


}
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package b_application_business_rules.use_cases.project_selection_gateways;
import a_enterprise_business_rules.entities.*;
import b_application_business_rules.entity_models.*;

public interface IEntityIDsToList {
/**
* This returns a concatenated string of column IDs of the given model.
*/
String EntityIDsToList(ProjectModel projectModel);
/**
* This returns a concatenated string of Task IDs of the given column model.
*/
String EntityIDsToList(ColumnModel columnModel);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package d_frameworks_and_drivers.database_management.DBControllers;

import b_application_business_rules.entity_models.ColumnModel;
import b_application_business_rules.entity_models.*;
import b_application_business_rules.entity_models.ProjectModel;
import b_application_business_rules.entity_models.TaskModel;

import b_application_business_rules.factories.ColumnModelFactory;
import b_application_business_rules.factories.ProjectModelFactory;
import b_application_business_rules.factories.TaskModelFactory;

import d_frameworks_and_drivers.database_management.ProjectUUIDArray;

import c_interface_adapters.DBAdapterInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
"UUID","State"
"xkfnfk","true"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

public class UUIDMap {
/**
*
* @return
*/
public static Map<String, String> convertCsvToHashMap() {
Expand All @@ -36,6 +35,7 @@ public static Map<String, String> convertCsvToHashMap() {
return csvDataMap;
}

}
// Old version
// public static void main(String[] args) {
// String csvFilePath = "DatabaseFiles/UniqueIDs/UniqueIDs.csv"; // Replace with the path to your CSV file
Expand All @@ -50,4 +50,4 @@ public static Map<String, String> convertCsvToHashMap() {
// e.printStackTrace();
// }
// }
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# General

## try-with-resources
When using try-with-resources e.g.
(FileWriter outputfile = new FileWriter("DatabaseFiles/Columns/Columns.csv");
CSVPrinter csvPrinter = new CSVPrinter(outputfile, CSVFormat.DEFAULT.withHeader()))
- make sure objects are AutoCloseable; they will close automatically after try block ends

# org.apache.commons.csv.CSVFormat;

## DEFAULT format:
only non-empty rows/records are processed.
Windows record/row separator used ("\r\n") -> potential errors in Unix-based systems ?
processes duplicate csv headers without errors -> avoid duplicates in headers
"" quotes enclose field values (in a single cell)
, delimeter separates fields

## withHeader()
- use only if csv files have first row with headers already

# org.apache.commons.csv.CSVParser;

##

# org.apache.commons.csv.CSVRecord;

##
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
"UUID","State"
"xkfnfk","true"

0 comments on commit 65d83cf

Please sign in to comment.