package org.sakaiproject.scheduler.events.hibernate;

import org.sakaiproject.api.app.scheduler.events.TriggerEvent;

import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: duffy
 * Date: Aug 26, 2010
 * Time: 5:04:12 PM
 * To change this template use File | Settings | File Templates.
 */
public class TriggerEventHibernateImpl
   implements TriggerEvent
{
    private TRIGGER_EVENT_TYPE
        type;
    private String
        id,
        jobName,
        triggerName;
    private Date
        time;
    private String
        message;

    public TriggerEventHibernateImpl()
    {}

    public void setId(String i)
    {
        id = i;
    }

    public String getId()
    {
        return id;
    }
    
    public void setEventType (TRIGGER_EVENT_TYPE t)
    {
        type = t;
    }

    public TRIGGER_EVENT_TYPE getEventType()
    {
        return type;
    }

    public void setJobName(String name)
    {
        jobName = name;
    }

    public String getJobName()
    {
        return jobName;
    }

    public void setTriggerName(String name)
    {
        triggerName = name;
    }

    public String getTriggerName()
    {
        return triggerName;
    }

    public void setTime(Date t)
    {
        time = t;
    }

    public Date getTime()
    {
        return time;
    }

    public void setMessage(String m)
    {
        message = m;
    }

    public String getMessage()
    {
        return message;
    }

    public int hashCode ()
    {
        return id.hashCode();
    }

    public boolean equals (Object o)
    {
        if (!TriggerEventHibernateImpl.class.isAssignableFrom (o.getClass()))
            return false;

        final TriggerEventHibernateImpl
            that = (TriggerEventHibernateImpl)o;

        if (this == that)
            return true;

        if (that == null)
            return false;

        return (id.equals(that.id));
    }
}

@@ -1444,24 +1444,35 @@
 %0A    %7D%0A%0A    
+@Override%0A%09
 public int h
@@ -1482,32 +1482,102 @@
 Code
- 
 ()
-%0A    %7B%0A        return
+ %7B%0A%09%09final int prime = 31;%0A%09%09int result = 1;%0A%09%09result = prime * result + ((id == null) ? 0 :
  id.
@@ -1586,29 +1586,55 @@
 shCode()
+)
 ;%0A
-    %7D%0A%0A    
+%09%09return result;%0A%09%7D%0A%0A    @Override%0A%09
 public b
@@ -1646,17 +1646,16 @@
 n equals
- 
 (Object 
@@ -1659,135 +1659,155 @@
 ct o
-)%0A    %7B%0A        if (!TriggerEventHibernateImpl.class.isAssignableFrom (o.getClass()))%0A            return false;%0A%0A        final 
+bj) %7B%0A%09%09if (this == obj)%0A%09%09%09return true;%0A%09%09if (obj == null)%0A%09%09%09return false;%0A%09%09if (!(obj instanceof TriggerEventHibernateImpl))%0A%09%09%09return false;%0A%09%09
 Trig
@@ -1831,25 +1831,14 @@
 Impl
-%0A            that
+ other
  = (
@@ -1867,90 +1867,59 @@
 mpl)
-o;%0A%0A        if (this == that)%0A            return true;%0A%0A        
+ obj;%0A%09%09if (id == null) %7B%0A%09%09%09
 if (
+o
 th
-at =
+er.id !
 = null)%0A
     
@@ -1918,20 +1918,12 @@
 ll)%0A
-            
+%09%09%09%09
 retu
@@ -1936,25 +1936,22 @@
 se;%0A
-%0A        return
+%09%09%7D else if
  (
+!
 id.e
@@ -1960,23 +1960,52 @@
 als(
+o
 th
-at
+er
 .id))
-;%0A    
+%0A%09%09%09return false;%0A%09%09return true;%0A%09
 %7D%0A%7D%0A

SAK-20339 let eclipse generate the equals method