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 taskListFilePath) {
        this.taskListFilePath = taskListFilePath;
    }

    public String getTaskListName() {
        return taskListName;
    }

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


    @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("\nItemList name : " + taskListName);
        return sb.toString();
    }

}

@@ -448,28 +448,28 @@
 vate String 
-task
+item
 ListFilePath
@@ -477,20 +477,20 @@
 = %22data/
-task
+item
 list.xml
@@ -507,28 +507,28 @@
 vate String 
-task
+item
 ListName = %22
@@ -529,20 +529,20 @@
 me = %22My
-Task
+Item
 List%22;%0A%0A
@@ -1073,28 +1073,28 @@
 c String get
-Task
+Item
 ListFilePath
@@ -1109,28 +1109,28 @@
      return 
-task
+item
 ListFilePath
@@ -1157,20 +1157,20 @@
 void set
-Task
+Item
 ListFile
@@ -1177,28 +1177,28 @@
 Path(String 
-task
+item
 ListFilePath
@@ -1210,28 +1210,28 @@
        this.
-task
+item
 ListFilePath
@@ -1233,20 +1233,20 @@
 ePath = 
-task
+item
 ListFile
@@ -1279,20 +1279,20 @@
 ring get
-Task
+Item
 ListName
@@ -1311,20 +1311,20 @@
  return 
-task
+item
 ListName
@@ -1351,20 +1351,21 @@
 void set
-Task
+ItemL
 istName(
@@ -1371,20 +1371,20 @@
 (String 
-task
+item
 ListName
@@ -1400,20 +1400,20 @@
    this.
-task
+item
 ListName
@@ -1415,20 +1415,20 @@
 tName = 
-task
+item
 ListName
@@ -1913,28 +1913,28 @@
 ects.equals(
-task
+item
 ListFilePath
@@ -1933,28 +1933,28 @@
 FilePath, o.
-task
+item
 ListFilePath
@@ -1989,20 +1989,20 @@
 .equals(
-task
+item
 ListName
@@ -2005,20 +2005,20 @@
 Name, o.
-task
+item
 ListName
@@ -2132,28 +2132,28 @@
 fsFilePath, 
-task
+item
 ListFilePath
@@ -2154,20 +2154,20 @@
 lePath, 
-task
+item
 ListName
@@ -2491,28 +2491,28 @@
 ation : %22 + 
-task
+item
 ListFilePath
@@ -2559,12 +2559,12 @@
 %22 + 
-task
+item
 List

Revert "Revert back to taskList naming in Config.java"