package seedu.ezdo.model;

import java.util.Objects;

import seedu.ezdo.commons.core.GuiSettings;

/**
 * Represents User's preferences.
 */
public class UserPrefs {

    public GuiSettings guiSettings;

    public GuiSettings getGuiSettings() {
        return guiSettings == null ? new GuiSettings() : guiSettings;
    }

    public void updateLastUsedGuiSetting(GuiSettings guiSettings) {
        this.guiSettings = guiSettings;
    }

    public UserPrefs() {
        this.setGuiSettings(500, 500, 0, 0);
    }

    public void setGuiSettings(double width, double height, int x, int y) {
        guiSettings = new GuiSettings(width, height, x, y);
    }

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

        UserPrefs o = (UserPrefs) other;

        return Objects.equals(guiSettings, o.guiSettings);
    }

    @Override
    public int hashCode() {
        return Objects.hash(guiSettings);
    }

    @Override
    public String toString() {
        return guiSettings.toString();
    }

}

@@ -90,16 +90,119 @@
 ettings;
+%0Aimport seedu.ezdo.model.todo.UniqueTaskList;%0Aimport seedu.ezdo.model.todo.UniqueTaskList.SortCriteria;
 %0A%0A/**%0A *
@@ -298,16 +298,54 @@
 ettings;
+%0A    public SortCriteria sortCriteria;
 %0A%0A    pu
@@ -593,24 +593,24 @@
 erPrefs() %7B%0A
-
         this
@@ -642,16 +642,78 @@
  0, 0);%0A
+        this.sortCriteria = UniqueTaskList.SortCriteria.NAME;%0A
     %7D%0A%0A 

Add SortCriteria field to UserPrefs