001: /*
002: * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
003: * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
004: * Copyright (C) 2007 Sebastien BALARD <sbalard@wilos-project.org>
005: * Copyright (C) 2007-2008 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
006: *
007: * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
008: * General Public License as published by the Free Software Foundation; either version 2 of the License,
009: * or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
012: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013: * GNU General Public License for more details.
014: *
015: * You should have received a copy of the GNU General Public License along with this program; if not,
016: * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
017: */
018:
019: package wilos.model.misc.concreteworkbreakdownelement;
020:
021: import org.apache.commons.lang.builder.EqualsBuilder;
022: import org.apache.commons.lang.builder.HashCodeBuilder;
023:
024: /**
025: *
026: * @author Sebastien
027: *
028: */
029: public class ConcreteWorkOrder implements Cloneable {
030:
031: private ConcreteWorkOrderId concreteWorkOrderId;
032:
033: private String concreteLinkType;
034:
035: private ConcreteWorkBreakdownElement concretePredecessor;
036:
037: private ConcreteWorkBreakdownElement concreteSuccessor;
038:
039: private String projectId;
040:
041: /**
042: * Default class constructor
043: *
044: */
045: public ConcreteWorkOrder() {
046: this .concreteWorkOrderId = null;
047: this .concretePredecessor = null;
048: this .concreteSuccessor = null;
049: this .concreteLinkType = "";
050: this .projectId = "";
051: }
052:
053: /**
054: * Defines if the specified Object is the same or has the same values as the
055: * current instance of the class.
056: *
057: * @param obj
058: * the Object to be compare to the ConcreteWorkOrder
059: * @return true if the specified Object is the same, false otherwise
060: */
061: @Override
062: public boolean equals(Object _obj) {
063: if (_obj instanceof ConcreteWorkOrder == false) {
064: return false;
065: }
066: if (this == _obj) {
067: return true;
068: }
069: ConcreteWorkOrder concreteWorkOrder = (ConcreteWorkOrder) _obj;
070: return new EqualsBuilder().append(this .concreteWorkOrderId,
071: concreteWorkOrder.concreteWorkOrderId).append(
072: this .concreteLinkType,
073: concreteWorkOrder.concreteLinkType).isEquals();
074: }
075:
076: /**
077: * Returns a hash code value for the object. This method is supported for
078: * the benefit of hash tables.
079: *
080: * @return the hash code of the current instance of ConcreteWorkOrder
081: */
082: @Override
083: public int hashCode() {
084: return new HashCodeBuilder(17, 37).append(
085: this .concreteWorkOrderId).toHashCode();
086: }
087:
088: /**
089: * Returns a copy of the current instance of ConcreteWorkOrder
090: *
091: * @return a copy of the ConcreteWorkOrder
092: * @throws CloneNotSupportedException
093: */
094: @Override
095: public ConcreteWorkOrder clone() throws CloneNotSupportedException {
096: ConcreteWorkOrder concreteWorkOrder = new ConcreteWorkOrder();
097: concreteWorkOrder.copy(this );
098: return concreteWorkOrder;
099: }
100:
101: /**
102: * Copy the values of the specified ConcreteWorkOrder into the current
103: * instance of the class.
104: *
105: * @param _concreteWorkOrder
106: * the ConcreteWorkOrder to copy
107: */
108: protected void copy(final ConcreteWorkOrder _concreteWorkOrder)
109: throws CloneNotSupportedException {
110: this .concretePredecessor = _concreteWorkOrder
111: .getConcretePredecessor();
112: this .concreteSuccessor = _concreteWorkOrder
113: .getConcreteSuccessor();
114: this .concreteLinkType = _concreteWorkOrder
115: .getConcreteLinkType();
116: this .projectId = _concreteWorkOrder.getProjectId();
117: this .concreteWorkOrderId = _concreteWorkOrder
118: .getConcreteWorkOrderId().clone();
119: }
120:
121: /**
122: * Returns the ConcreteWorkBreakdownElement predecessor assigned to the
123: * ConcreteWorkOrder
124: *
125: * @return the concretePredecessor attribute
126: */
127: public ConcreteWorkBreakdownElement getConcretePredecessor() {
128: return this .concretePredecessor;
129: }
130:
131: /**
132: * Sets the ConcreteWorkBreakdownElement predecessor assigned to the
133: * ConcreteWorkOrder
134: *
135: * @param concretePredecessor
136: * the concretePredecessor to set
137: */
138: public void setConcretePredecessor(
139: ConcreteWorkBreakdownElement _concretePredecessor) {
140: this .concretePredecessor = _concretePredecessor;
141: }
142:
143: /**
144: * Returns the ConcreteWorkBreakdownElement successor assigned to the
145: * ConcreteWorkOrder
146: *
147: * @return the concreteSuccessor
148: */
149: public ConcreteWorkBreakdownElement getConcreteSuccessor() {
150: return this .concreteSuccessor;
151: }
152:
153: /**
154: * Sets the ConcreteWorkBreakdownElement successor assigned to the
155: * ConcreteWorkOrder
156: *
157: * @param concreteSuccessor
158: * the concreteSuccessor to set
159: */
160: public void setConcreteSuccessor(
161: ConcreteWorkBreakdownElement concreteSuccessor) {
162: this .concreteSuccessor = concreteSuccessor;
163: }
164:
165: /**
166: * Returns the String that symbolizes the type of the concrete link of the
167: * ConcreteWorkOrder
168: *
169: * @return the concrete link
170: */
171: public String getConcreteLinkType() {
172: return this .concreteLinkType;
173: }
174:
175: /**
176: * Sets the ConcreteWorkBreakdownElement successor assigned to the
177: * ConcreteWorkOrder
178: *
179: * @param concreteSuccessor
180: * the concreteSuccessor to set
181: */
182: public void setConcreteLinkType(String _concreteLinkType) {
183: this .concreteLinkType = _concreteLinkType;
184: }
185:
186: /**
187: * Returns the ConcreteWorkOrderId identifying the ConcreteWorkOrder
188: *
189: * @return the concreteWorkOrderId
190: */
191: public ConcreteWorkOrderId getConcreteWorkOrderId() {
192: return concreteWorkOrderId;
193: }
194:
195: /**
196: * Sets the ConcreteWorkOrderId identifying the ConcreteWorkOrder
197: *
198: * @param concreteWorkOrderId
199: * the concreteWorkOrderId to set
200: */
201: public void setConcreteWorkOrderId(
202: ConcreteWorkOrderId concreteWorkOrderId) {
203: this .concreteWorkOrderId = concreteWorkOrderId;
204: }
205:
206: /**
207: * Returns the identifier of the Project link to the ConcreteWorkOrder
208: *
209: * @return the projectId
210: */
211: public String getProjectId() {
212: return this .projectId;
213: }
214:
215: /**
216: * Sets the identifier of the Project link to the ConcreteWorkOrder
217: *
218: * @param _projectId
219: * the projectId to set
220: */
221: public void setProjectId(String _projectId) {
222: this.projectId = _projectId;
223: }
224:
225: }
|