001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/matrix/api/src/java/org/theospi/portfolio/matrix/model/WizardPageForm.java $
003: * $Id: WizardPageForm.java 20762 2007-01-29 19:35:58Z chmaurer@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006, 2007 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.theospi.portfolio.matrix.model;
021:
022: import org.sakaiproject.metaobj.shared.model.Id;
023: import org.sakaiproject.metaobj.shared.model.IdentifiableObject;
024:
025: /**
026: * @author rpembry
027: */
028: public class WizardPageForm extends IdentifiableObject {
029: private Id artifactId;
030: private WizardPage wizardPage;
031: private String formType;
032:
033: /**
034: * @return Returns the artifactId.
035: */
036: public Id getArtifactId() {
037: return artifactId;
038: }
039:
040: /**
041: * @param artifactId The artifactId to set.
042: */
043: public void setArtifactId(Id artifactId) {
044: this .artifactId = artifactId;
045: }
046:
047: /**
048: * @return Returns the wizardPage that contains this Attachment
049: */
050:
051: public WizardPage getWizardPage() {
052: return wizardPage;
053: }
054:
055: /**
056: * @param wizardPage The parent wizardPage for this Attachment
057: */
058: public void setWizardPage(WizardPage wizardPage) {
059: this .wizardPage = wizardPage;
060: }
061:
062: /* (non-Javadoc)
063: * @see java.lang.Object#equals(java.lang.Object)
064: * the OspMigrationJob class creates instances of this class.
065: * it doesn't set the id, thus it is null, but each is different from each other
066: */
067: public boolean equals(Object other) {
068: if (other == this )
069: return true;
070: if (other == null || !(other instanceof WizardPageForm))
071: return false;
072: //TODO need better equals method
073:
074: WizardPageForm form = (WizardPageForm) other;
075:
076: if (this .getArtifactId().equals(form.getArtifactId())
077: && this .getWizardPage().getVirtualId().equals(
078: form.getWizardPage().getVirtualId()))
079: return true;
080:
081: if (this .getVirtualId() == null && form.getVirtualId() != null)
082: return false;
083: if (this .getVirtualId() != null && form.getVirtualId() == null)
084: return false;
085: //if(this.getId() == null) return false;
086: return (this .getVirtualId().equals(form.getVirtualId()));
087:
088: }
089:
090: /* (non-Javadoc)
091: * @see java.lang.Object#hashCode()
092: */
093: public int hashCode() {
094: String compositeId = "";
095: Id id = this .getVirtualId();
096: try {
097: compositeId = getArtifactId().getValue() + getFormType()
098: + getWizardPage().getId();
099: } catch (Exception e) {
100: compositeId = id.getValue();
101: }
102: return compositeId.hashCode();
103: }
104:
105: /*
106: public String toString() {
107: return "<Cell id:" + this.wizardPage.getId() + ", artifactId:" + this.getArtifactId() + "]>";
108: }
109: */
110:
111: /**
112: * @return Returns the formType.
113: */
114: public String getFormType() {
115: return formType;
116: }
117:
118: /**
119: * @param formType The formType to set.
120: */
121: public void setFormType(String formType) {
122: this.formType = formType;
123: }
124: }
|