/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package notificationprofile.model;

import java.io.Serializable;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 *
 * @author HannahGarthwaite
 */
public class Notification implements Serializable {
    private int id;
    private String name;
    private String description;
    private GregorianCalendar timeIssued;
    private boolean read;

    /**
     * Default constructor
     * @param id id
     * @param name title
     * @param description description
     * @param timeIssued time
     * @param read boolean if it's been read
     */
    public Notification(int id, String name, String description, GregorianCalendar timeIssued, boolean read){
        this.id = id;
        this.name = name;
        this.description = description;
        this.timeIssued = timeIssued;
        this.read = read;
    }
    
    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }
    
    public String getTimeString(){
        Date theDate = timeIssued.getTime();
        return theDate.getMonth()+"/"+theDate.getDate()+" "+theDate.getHours()+":"+theDate.getMinutes();
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the timeIssued
     */
    public GregorianCalendar getTimeIssued() {
        return timeIssued;
    }

    /**
     * @param timeIssued the timeIssued to set
     */
    public void setTimeIssued(GregorianCalendar timeIssued) {
        this.timeIssued = timeIssued;
    }

    /**
     * @return the read
     */
    public boolean isRead() {
        return read;
    }

    /**
     * @param read the read to set
     */
    public void setRead(boolean read) {
        this.read = read;
    }
    
}

@@ -483,33 +483,20 @@
 private 
-GregorianCalendar
+Date
  timeIss
@@ -793,33 +793,20 @@
 iption, 
-GregorianCalendar
+Date
  timeIss
@@ -1334,22 +1334,14 @@
     
-Date theDate =
+return
  tim
@@ -1352,42 +1352,8 @@
 ued.
-getTime();%0A        return theDate.
 getM
@@ -1364,22 +1364,25 @@
 ()+%22/%22+t
-heDate
+imeIssued
 .getDate
@@ -1389,22 +1389,25 @@
 ()+%22 %22+t
-heDate
+imeIssued
 .getHour
@@ -1419,14 +1419,17 @@
 :%22+t
-heDate
+imeIssued
 .get
@@ -1910,33 +1910,20 @@
  public 
-GregorianCalendar
+Date
  getTime
@@ -2060,33 +2060,20 @@
 eIssued(
-GregorianCalendar
+Date
  timeIss

set timeIssued to Date