/********************************************************************************** * $URL: https://source.sakaiproject.org/svn/sam/trunk/samigo-api/src/java/org/sakaiproject/tool/assessment/data/dao/grading/GradingAttachmentData.java $ * $Id: GradingAttachmentData.java 106463 2012-04-02 12:20:09Z david.horwitz@uct.ac.za $ *********************************************************************************** * * Copyright (c) 2004, 2005, 2006 The Sakai Foundation. * * Licensed under the Educational Community License, Version 1.0 (the"License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/ecl1.php * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * **********************************************************************************/ package org.sakaiproject.tool.assessment.data.dao.grading; import java.io.Serializable; import java.util.Date; import org.sakaiproject.tool.assessment.data.ifc.assessment.AttachmentIfc; public class GradingAttachmentData implements Serializable, AttachmentIfc { /** * */ private static final long serialVersionUID = -7687123123293871111L; private Long attachmentId; private String resourceId; private String filename; private String mimeType; private Long fileSize; // in kilobyte private String description; private String location; private Boolean isLink; private Integer status; private String createdBy; private Date createdDate; private String lastModifiedBy; private Date lastModifiedDate; private Long attachmentType; public GradingAttachmentData() { } public GradingAttachmentData(String resourceId, Long attachmentType, String filename, String mimeType, Long fileSize, String description, String location, Boolean isLink, Integer status, String createdBy, Date createdDate, String lastModifiedBy, Date lastModifiedDate) { this.resourceId = resourceId; this.attachmentType = attachmentType; this.filename = filename; this.mimeType = mimeType; this.fileSize = fileSize; this.description = description; this.location = location; this.isLink = isLink; this.status = status; this.createdBy = createdBy; this.createdDate = createdDate; this.lastModifiedBy = lastModifiedBy; this.lastModifiedDate = lastModifiedDate; } public GradingAttachmentData(Long attachmentId, String resourceId, Long attachmentType, String filename, String mimeType, Long fileSize, String description, String location, Boolean isLink, Integer status, String createdBy, Date createdDate, String lastModifiedBy, Date lastModifiedDate) { this.attachmentId = attachmentId; this.resourceId = resourceId; this.attachmentType = attachmentType; this.filename = filename; this.mimeType = mimeType; this.fileSize = fileSize; this.description = description; this.location = location; this.isLink = isLink; this.status = status; this.createdBy = createdBy; this.createdDate = createdDate; this.lastModifiedBy = lastModifiedBy; this.lastModifiedDate = lastModifiedDate; } public Long getAttachmentId() { return attachmentId; } public void setAttachmentId(Long attachmentId) { this.attachmentId = attachmentId; } public String getResourceId() { return resourceId; } public void setResourceId(String resourceId) { this.resourceId = resourceId; } public String getFilename() { return filename; } public void setFilename(String filename) { this.filename = filename; } public void setMimeType(String mimeType) { this.mimeType = mimeType; } public String getMimeType() { return mimeType; } public Long getFileSize() { return fileSize; } public void setFileSize(Long fileSize) { this.fileSize = fileSize; } public String getDescription() { return description; } public void setDescription(String pdescription) { description = pdescription; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public Boolean getIsLink() { return isLink; } public void setIsLink(Boolean isLink) { this.isLink = isLink; } public Integer getStatus() { return this.status; } public void setStatus(Integer status) { this.status = status; } public String getCreatedBy() { return this.createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public Date getCreatedDate() { return this.createdDate; } public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } public String getLastModifiedBy() { return this.lastModifiedBy; } public void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } public Date getLastModifiedDate() { return this.lastModifiedDate; } public void setLastModifiedDate(Date lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } public Long getAttachmentType() { return attachmentType; } public void setAttachmentType(Long attachmentType) { } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((attachmentId == null) ? 0 : attachmentId.hashCode()); result = prime * result + ((attachmentType == null) ? 0 : attachmentType.hashCode()); result = prime * result + ((createdBy == null) ? 0 : createdBy.hashCode()); result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((fileSize == null) ? 0 : fileSize.hashCode()); result = prime * result + ((filename == null) ? 0 : filename.hashCode()); result = prime * result + ((isLink == null) ? 0 : isLink.hashCode()); result = prime * result + ((lastModifiedBy == null) ? 0 : lastModifiedBy.hashCode()); result = prime * result + ((lastModifiedDate == null) ? 0 : lastModifiedDate.hashCode()); result = prime * result + ((location == null) ? 0 : location.hashCode()); result = prime * result + ((mimeType == null) ? 0 : mimeType.hashCode()); result = prime * result + ((resourceId == null) ? 0 : resourceId.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; GradingAttachmentData other = (GradingAttachmentData) obj; if (attachmentId == null) { if (other.attachmentId != null) return false; } else if (!attachmentId.equals(other.attachmentId)) return false; if (attachmentType == null) { if (other.attachmentType != null) return false; } else if (!attachmentType.equals(other.attachmentType)) return false; if (createdBy == null) { if (other.createdBy != null) return false; } else if (!createdBy.equals(other.createdBy)) return false; if (createdDate == null) { if (other.createdDate != null) return false; } else if (!createdDate.equals(other.createdDate)) return false; if (description == null) { if (other.description != null) return false; } else if (!description.equals(other.description)) return false; if (fileSize == null) { if (other.fileSize != null) return false; } else if (!fileSize.equals(other.fileSize)) return false; if (filename == null) { if (other.filename != null) return false; } else if (!filename.equals(other.filename)) return false; if (isLink == null) { if (other.isLink != null) return false; } else if (!isLink.equals(other.isLink)) return false; if (lastModifiedBy == null) { if (other.lastModifiedBy != null) return false; } else if (!lastModifiedBy.equals(other.lastModifiedBy)) return false; if (lastModifiedDate == null) { if (other.lastModifiedDate != null) return false; } else if (!lastModifiedDate.equals(other.lastModifiedDate)) return false; if (location == null) { if (other.location != null) return false; } else if (!location.equals(other.location)) return false; if (mimeType == null) { if (other.mimeType != null) return false; } else if (!mimeType.equals(other.mimeType)) return false; if (resourceId == null) { if (other.resourceId != null) return false; } else if (!resourceId.equals(other.resourceId)) return false; if (status == null) { if (other.status != null) return false; } else if (!status.equals(other.status)) return false; return true; } }