package t16b4.yats.commons.core;

import java.util.Objects;
import java.util.logging.Level;

/**
 * Config values used by the app
 */
public class Config {

    public static final String DEFAULT_CONFIG_FILE = "config.json";

    // Config values customizable through config file
    private String appTitle = "Yet Another Task Scheduler";
    private Level logLevel = Level.INFO;
    private String userPrefsFilePath = "preferences.json";
    private String taskListFilePath = "data/tasklist.xml";
    private String taskListName = "MyTaskList";


    public String getAppTitle() {
        return appTitle;
    }

    public void setAppTitle(String appTitle) {
        this.appTitle = appTitle;
    }

    public Level getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(Level logLevel) {
        this.logLevel = logLevel;
    }

    public String getUserPrefsFilePath() {
        return userPrefsFilePath;
    }

    public void setUserPrefsFilePath(String userPrefsFilePath) {
        this.userPrefsFilePath = userPrefsFilePath;
    }

    public String getTaskListFilePath() {
        return taskListFilePath;
    }

    public void setTaskListFilePath(String addressBookFilePath) {
        this.taskListFilePath = addressBookFilePath;
    }

    public String getTaskListName() {
        return taskListName;
    }

    public void setTaskListName(String addressBookName) {
        this.taskListName = addressBookName;
    }


    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if (!(other instanceof Config)) { //this handles null as well.
            return false;
        }

        Config o = (Config) other;

        return Objects.equals(appTitle, o.appTitle)
                && Objects.equals(logLevel, o.logLevel)
                && Objects.equals(userPrefsFilePath, o.userPrefsFilePath)
                && Objects.equals(taskListFilePath, o.taskListFilePath)
                && Objects.equals(taskListName, o.taskListName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(appTitle, logLevel, userPrefsFilePath, taskListFilePath, taskListName);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("App title : " + appTitle);
        sb.append("\nCurrent log level : " + logLevel);
        sb.append("\nPreference file Location : " + userPrefsFilePath);
        sb.append("\nLocal data file location : " + taskListFilePath);
        sb.append("\nTaskList name : " + taskListName);
        return sb.toString();
    }

}

@@ -308,34 +308,19 @@
  = %22
-Yet Another Task Scheduler
+Address App
 %22;%0A 
@@ -437,24 +437,27 @@
  String 
-taskList
+addressBook
 FilePath
@@ -469,16 +469,19 @@
 ata/
-tasklist
+addressbook
 .xml
@@ -506,34 +506,40 @@
 ing 
-taskListName = %22MyTaskList
+addressBookName = %22MyAddressBook
 %22;%0A%0A
@@ -1074,24 +1074,27 @@
 ring get
-TaskList
+AddressBook
 FilePath
@@ -1113,24 +1113,27 @@
  return 
-taskList
+addressBook
 FilePath
@@ -1160,24 +1160,27 @@
 void set
-TaskList
+AddressBook
 FilePath
@@ -1223,24 +1223,27 @@
    this.
-taskList
+addressBook
 FilePath
@@ -1294,24 +1294,27 @@
 ring get
-TaskList
+AddressBook
 Name() %7B
@@ -1329,24 +1329,27 @@
  return 
-taskList
+addressBook
 Name;%0A  
@@ -1372,24 +1372,27 @@
 void set
-TaskList
+AddressBook
 Name(Str
@@ -1427,24 +1427,27 @@
    this.
-taskList
+addressBook
 Name = a
@@ -1950,24 +1950,27 @@
 .equals(
-taskList
+addressBook
 FilePath
@@ -1973,24 +1973,27 @@
 Path, o.
-taskList
+addressBook
 FilePath
@@ -2032,32 +2032,38 @@
 als(
-taskListName, o.taskList
+addressBookName, o.addressBook
 Name
@@ -2185,34 +2185,40 @@
 th, 
-taskListFilePath, taskList
+addressBookFilePath, addressBook
 Name
@@ -2546,24 +2546,27 @@
 n : %22 + 
-taskList
+addressBook
 FilePath
@@ -2593,16 +2593,19 @@
 (%22%5Cn
-TaskList
+AddressBook
  nam
@@ -2616,16 +2616,19 @@
 %22 + 
-taskList
+addressBook
 Name

Revert "Updated Config.java"