Created controller for saving app data to CSV
This commit is contained in:
1 parent
d5b1f30c6c
commit
4932161b61
2 files changed
+84
-158
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package cvbuilder.model;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class CsvExportSettings {
|
||||
private static CsvExportSettings instance;
|
||||
private Map<String, Boolean> includeMap = new HashMap<>();
|
||||
|
||||
private CsvExportSettings() {
|
||||
// Initialize default values for all fields to be included
|
||||
includeMap.put("title", true);
|
||||
includeMap.put("name", true);
|
||||
includeMap.put("email", true);
|
||||
includeMap.put("phone", true);
|
||||
includeMap.put("address", true);
|
||||
}
|
||||
|
||||
public static CsvExportSettings getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new CsvExportSettings();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void setInclude(String fieldName, boolean include) {
|
||||
includeMap.put(fieldName.toLowerCase(), include);
|
||||
}
|
||||
|
||||
public boolean isIncluded(String fieldName) {
|
||||
return includeMap.getOrDefault(fieldName.toLowerCase(), true);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user