001: /***********************************************************************************
002: *
003: * Copyright (c) 2005 The Regents of the University of California, The MIT Corporation
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: **********************************************************************************/package org.sakaiproject.tool.gradebook;
018:
019: import org.apache.commons.logging.Log;
020: import org.apache.commons.logging.LogFactory;
021: import org.apache.commons.lang.builder.ToStringBuilder;
022: import org.apache.commons.lang.builder.EqualsBuilder;
023: import org.apache.commons.lang.builder.HashCodeBuilder;
024:
025: import java.util.Date;
026: import java.io.Serializable;
027:
028: /**
029: * User: louis
030: * Date: Jun 12, 2006
031: * Time: 3:10:12 PM
032: */
033: public class Spreadsheet implements Serializable {
034:
035: protected Gradebook gradebook;
036: protected Long id;
037: protected int version;
038: protected String content;
039: protected String creator;
040: protected String name;
041: protected Date dateCreated;
042:
043: protected static final Log log = LogFactory
044: .getLog(Spreadsheet.class);
045:
046: public Spreadsheet(Gradebook gradebook, String content,
047: String creator, String name, Date dateCreated) {
048:
049: this .gradebook = gradebook;
050: this .content = content;
051: this .creator = creator;
052: this .name = name;
053: this .dateCreated = dateCreated;
054: }
055:
056: public Spreadsheet() {
057: }
058:
059: public Gradebook getGradebook() {
060: return gradebook;
061: }
062:
063: public void setGradebook(Gradebook gradebook) {
064: this .gradebook = gradebook;
065: }
066:
067: public Long getId() {
068: return id;
069: }
070:
071: public void setId(Long id) {
072: this .id = id;
073: }
074:
075: public int getVersion() {
076: return version;
077: }
078:
079: public void setVersion(int version) {
080: this .version = version;
081: }
082:
083: public String getContent() {
084: return content;
085: }
086:
087: public void setContent(String content) {
088: this .content = content;
089: }
090:
091: public String getCreator() {
092: return creator;
093: }
094:
095: public void setCreator(String creator) {
096: this .creator = creator;
097: }
098:
099: public String getName() {
100: return name;
101: }
102:
103: public void setName(String name) {
104: this .name = name;
105: }
106:
107: public Date getDateCreated() {
108: return dateCreated;
109: }
110:
111: public void setDateCreated(Date dateCreated) {
112: this .dateCreated = dateCreated;
113: }
114:
115: public boolean equals(Object other) {
116: if (!(other instanceof Spreadsheet)) {
117: return false;
118: }
119: Spreadsheet sp = (Spreadsheet) other;
120: return new EqualsBuilder().append(gradebook, sp.getGradebook())
121: .append(id, sp.getId()).append(name, sp.getName())
122: .isEquals();
123: }
124:
125: public int hashCode() {
126: return new HashCodeBuilder().append(gradebook).append(id)
127: .append(name).toHashCode();
128: }
129:
130: public String toString() {
131: return new ToStringBuilder(this ).append("id", id).append(
132: "name", name).toString();
133: }
134: }
|