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 itemListFilePath = "data/itemlist.xml";
    private String itemListName = "MyItemList";


    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 itemListFilePath;
    }

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

    public String getTaskListName() {
        return itemListName;
    }

    public void setTaskListName(String addressBookName) {
        this.itemListName = 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(itemListFilePath, o.itemListFilePath)
                && Objects.equals(itemListName, o.itemListName);
    }

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

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

}

@@ -448,28 +448,28 @@
 vate String 
-item
+task
 ListFilePath
@@ -477,20 +477,20 @@
 = %22data/
-item
+task
 list.xml
@@ -511,20 +511,20 @@
  String 
-item
+task
 ListName
@@ -529,20 +529,20 @@
 me = %22My
-Item
+Task
 List%22;%0A%0A
@@ -1109,28 +1109,28 @@
      return 
-item
+task
 ListFilePath
@@ -1213,28 +1213,28 @@
        this.
-item
+task
 ListFilePath
@@ -1317,20 +1317,20 @@
  return 
-item
+task
 ListName
@@ -1409,20 +1409,20 @@
    this.
-item
+task
 ListName
@@ -1925,28 +1925,28 @@
 ects.equals(
-item
+task
 ListFilePath
@@ -1945,28 +1945,28 @@
 FilePath, o.
-item
+task
 ListFilePath
@@ -2001,20 +2001,20 @@
 .equals(
-item
+task
 ListName
@@ -2017,20 +2017,20 @@
 Name, o.
-item
+task
 ListName
@@ -2144,28 +2144,28 @@
 fsFilePath, 
-item
+task
 ListFilePath
@@ -2166,20 +2166,20 @@
 lePath, 
-item
+task
 ListName
@@ -2503,28 +2503,28 @@
 ation : %22 + 
-item
+task
 ListFilePath
@@ -2551,12 +2551,12 @@
 (%22%5Cn
-Item
+Task
 List
@@ -2571,12 +2571,12 @@
 %22 + 
-item
+task
 List

Revert "Modified variable name"