package com.hmsoft.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 * 
 * @author zq
 *
 */
public class SelectedCourse {

	private IntegerProperty coursePlanId;
	private StringProperty courseCode;
	private StringProperty courseName;
	private StringProperty outlineName;//教材大纲
	private StringProperty bookName;//教材名称
	private StringProperty bianZhu;//编著
	private StringProperty press;//出版社
	private StringProperty publications;//版次
	private StringProperty cengci;//层次
	private transient StringProperty confirmDesc;//学校确认反馈
	private transient StringProperty isSpecifyDesc;//是否命题办指定的
	
	public SelectedCourse() {
		this.coursePlanId = new SimpleIntegerProperty();
		this.courseCode = new SimpleStringProperty();
		this.courseName = new SimpleStringProperty();
		this.outlineName = new SimpleStringProperty();
		this.bookName = new SimpleStringProperty();
		this.bianZhu = new SimpleStringProperty();
		this.press = new SimpleStringProperty();
		this.publications = new SimpleStringProperty();
		this.cengci = new SimpleStringProperty();
		this.confirmDesc = new SimpleStringProperty();
		this.isSpecifyDesc = new SimpleStringProperty();
	}
	
	public Integer getCoursePlanId() {
		return coursePlanId.get();
	}
	public void setCoursePlanId(Integer coursePlanId) {
		this.coursePlanId.set(coursePlanId);
	}
	public String getCourseCode() {
		return courseCode.get();
	}
	public void setCourseCode(String courseCode) {
		this.courseCode.set(courseCode);
	}
	public String getCourseName() {
		return courseName.get();
	}
	public void setCourseName(String courseName) {
		this.courseName.set(courseName);
	}
	public String getOutlineName() {
		return outlineName.get();
	}
	public void setOutlineName(String outlineName) {
		this.outlineName.set(outlineName);
	}
	public String getBookName() {
		return bookName.get();
	}
	public void setBookName(String bookName) {
		this.bookName.set(bookName);
	}
	public String getBianZhu() {
		return bianZhu.get();
	}
	public void setBianZhu(String bianZhu) {
		this.bianZhu.set(bianZhu);
	}
	public String getPress() {
		return press.get();
	}
	public void setPress(String press) {
		this.press.set(press);
	}
	public String getPublications() {
		return publications.get();
	}
	public void setPublications(String publications) {
		this.publications.set(publications);
	}
	public String getCengci() {
		return cengci.get();
	}
	public void setCengci(String cengci) {
		this.cengci.set(cengci);
	}
	public String getConfirmDesc() {
		return confirmDesc.get();
	}
	public void setConfirmDesc(String confirmDesc) {
		this.confirmDesc.set(confirmDesc);
	}
	public String getIsSpecifyDesc() {
		return isSpecifyDesc.get();
	}

	public void setIsSpecifyDesc(String isSpecifyDesc) {
		this.isSpecifyDesc.set(isSpecifyDesc);
	}

	public int hashCode() {
	     return new HashCodeBuilder(17, 37).
	       append(this.coursePlanId.get()).
	       append(this.courseCode.get()).
	       append(this.courseName.get()).
	       toHashCode();
	}
	
	public boolean equals(Object obj) {
		   if (obj == null) { return false; }
		   if (obj == this) { return true; }
		   if (obj.getClass() != getClass()) {
		     return false;
		   }
		   SelectedCourse oth = (SelectedCourse) obj;
		   return new EqualsBuilder()
		                 .append(this.coursePlanId.get(), oth.coursePlanId.get())
		                 .append(this.courseCode.get(), oth.courseCode.get())
		                 .append(this.courseName.get(), oth.courseName.get())
		                 .isEquals();
	}
}
