package org.jboss.cache.data;

/**
 * @author Brian Stansberry
 * @@org.jboss.cache.aop.AopMarker
 */
public class Course  implements java.io.Serializable {
   protected String title;
   protected String instructor;
   protected String room;

   public void setTitle(String title)
   {
      this.title = title;
   }

   public String getTitle()
   {
      return this.title;
   }

   public void setRoom(String room)
   {
      this.room = room;
   }

   public String getRoom()
   {
      return this.room;
   }
   
   public void setInstructor(String instructor)
   {
      this.instructor = instructor;
   }
   
   public String getInstructor()
   {
      return instructor;
   }

   public String toString()
   {
      StringBuffer buf = new StringBuffer();
      buf.append("{Title = " +title).append(", Instructor = " + instructor).append(", Room = " +room + "}\n");

      return buf.toString();
   }
   
   public boolean equals(Object other)
   {
      if (this == other)
         return true;
         
      if (other instanceof Course) {
         String otherTitle = ((Course) other).getTitle();
         return (title == otherTitle || (title != null && title.equals(otherTitle)));
      } 
      
      return false;
   }
   
   public int hashCode()
   {
      return title == null ? 0 : title.hashCode();
   }
}
