/*
 * Copyright (c) 2017 Michael D'Arcy and Brianne O'Niel.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.group13.androidsdk.mycards;


import java.util.Date;

/**
 * Represents a "rule" for the notification rules list. Each notification rule has a date pattern
 * (used to select times that the notification is active) and a boolean to indicate whether the
 * rule is enabled. It also has an ID so it can be uniquely identified. The methods themselves
 * should be mostly self-explanatory (just getter/setter type methods).
 */
@SuppressWarnings("unused")
public class NotificationRule {

    private int id = -1;
    private SimpleDatePattern datePattern = new SimpleDatePattern(new Date(), new Date(), 0, 0);
    private boolean enabled = true;


    public NotificationRule(int id, SimpleDatePattern datePattern, boolean enabled) {
        this.id = id;
        this.datePattern = datePattern;
        this.enabled = enabled;
    }

    public NotificationRule(int id, SimpleDatePattern datePattern) {
        this(id, datePattern, true);
    }


    public void setDatePattern(SimpleDatePattern dp) {
        this.datePattern = dp;
    }

    public SimpleDatePattern getDatePattern() {
        return this.datePattern;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public boolean isEnabled() {
        return this.enabled;
    }

    public int getId() {
        return this.id;
    }

}

@@ -1964,10 +1964,825 @@
 %0A    %7D%0A%0A
+    public void setId(int id) %7B%0A        this.id = id;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (o == null %7C%7C getClass() != o.getClass()) %7B%0A            return false;%0A        %7D%0A%0A        NotificationRule that = (NotificationRule) o;%0A%0A        if (id != that.id) %7B%0A            return false;%0A        %7D%0A        if (enabled != that.enabled) %7B%0A            return false;%0A        %7D%0A        return datePattern != null ? datePattern.equals(that.datePattern) : that.datePattern ==%0A                null;%0A%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        int result = id;%0A        result = 31 * result + (datePattern != null ? datePattern.hashCode() : 0);%0A        result = 31 * result + (enabled ? 1 : 0);%0A        return result;%0A    %7D%0A
 %7D%0A

Add equals(), hashcode() and setId() for NotificationRule