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 getItemListFilePath() {
        return itemListFilePath;
    }

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

    public String getItemListName() {
        return itemListName;
    }

    public void setItemListName(String itemListName) {
        this.itemListName = itemListName;
    }


    @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
@@ -507,28 +507,28 @@
 vate String 
-item
+task
 ListName = %22
@@ -529,20 +529,20 @@
 me = %22My
-Item
+Task
 List%22;%0A%0A
@@ -1073,28 +1073,28 @@
 c String get
-Item
+Task
 ListFilePath
@@ -1109,28 +1109,28 @@
      return 
-item
+task
 ListFilePath
@@ -1153,28 +1153,28 @@
 lic void set
-Item
+Task
 ListFilePath
@@ -1177,28 +1177,28 @@
 Path(String 
-item
+task
 ListFilePath
@@ -1210,28 +1210,28 @@
        this.
-item
+task
 ListFilePath
@@ -1233,20 +1233,20 @@
 ePath = 
-item
+task
 ListFile
@@ -1279,20 +1279,20 @@
 ring get
-Item
+Task
 ListName
@@ -1311,20 +1311,20 @@
  return 
-item
+task
 ListName
@@ -1351,21 +1351,20 @@
 void set
-ItemL
+Task
 istName(
@@ -1370,20 +1370,20 @@
 (String 
-item
+task
 ListName
@@ -1399,20 +1399,20 @@
    this.
-item
+task
 ListName
@@ -1414,20 +1414,20 @@
 tName = 
-item
+task
 ListName
@@ -1912,28 +1912,28 @@
 ects.equals(
-item
+task
 ListFilePath
@@ -1932,28 +1932,28 @@
 FilePath, o.
-item
+task
 ListFilePath
@@ -1988,20 +1988,20 @@
 .equals(
-item
+task
 ListName
@@ -2004,20 +2004,20 @@
 Name, o.
-item
+task
 ListName
@@ -2131,28 +2131,28 @@
 fsFilePath, 
-item
+task
 ListFilePath
@@ -2153,20 +2153,20 @@
 lePath, 
-item
+task
 ListName
@@ -2490,28 +2490,28 @@
 ation : %22 + 
-item
+task
 ListFilePath
@@ -2558,12 +2558,12 @@
 %22 + 
-item
+task
 List

Revert back to taskList naming in Config.java