001: /*
002: * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
003: * Copyright (C) 2007 Sebastien BALARD <sbalard@wilos-project.org>
004: * Copyright (C) 2007-2008 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
005: *
006: * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
007: * General Public License as published by the Free Software Foundation; either version 2 of the License,
008: * or (at your option) any later version.
009: *
010: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
011: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: *
014: * You should have received a copy of the GNU General Public License along with this program; if not,
015: * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
016: */
017:
018: package wilos.model.misc.concreteworkbreakdownelement;
019:
020: import java.io.Serializable;
021:
022: import org.apache.commons.lang.builder.EqualsBuilder;
023:
024: /**
025: *
026: * @author Sebastien BALARD
027: *
028: */
029: public class ConcreteWorkOrderId implements Serializable, Cloneable {
030:
031: private static final long serialVersionUID = 1L;
032:
033: private String concretePredecessorId;
034:
035: private String concreteSuccessorId;
036:
037: private String concreteLinkTypeId;
038:
039: /**
040: * Class constructor
041: *
042: */
043: public ConcreteWorkOrderId() {
044: this .concretePredecessorId = "";
045: this .concreteSuccessorId = "";
046: this .concreteLinkTypeId = "";
047: }
048:
049: /**
050: * Defines if the specified Object is the same or has the same values as the
051: * current instance of the class.
052: *
053: * @param obj
054: * the Object to be compare to the ConcreteWorkOrderId
055: * @return true if the specified Object is the same, false otherwise
056: */
057: public boolean equals(Object _obj) {
058: if (_obj instanceof ConcreteWorkOrderId == false) {
059: return false;
060: }
061: if (this == _obj) {
062: return true;
063: }
064: ConcreteWorkOrderId concreteWorkOrderId = (ConcreteWorkOrderId) _obj;
065: return new EqualsBuilder().append(this .concretePredecessorId,
066: concreteWorkOrderId.concretePredecessorId).append(
067: this .concreteSuccessorId,
068: concreteWorkOrderId.concreteSuccessorId).append(
069: this .concreteLinkTypeId,
070: concreteWorkOrderId.concreteLinkTypeId).isEquals();
071: }
072:
073: /**
074: * Returns a copy of the current instance of ConcreteWorkOrderId
075: *
076: * @return a copy of the ConcreteWorkOrderId
077: * @throws CloneNotSupportedException
078: */
079: @Override
080: public ConcreteWorkOrderId clone()
081: throws CloneNotSupportedException {
082: ConcreteWorkOrderId concreteWorkOrderId = new ConcreteWorkOrderId();
083: concreteWorkOrderId.copy(this );
084: return concreteWorkOrderId;
085: }
086:
087: /**
088: * Copy the values of the specified ConcreteWorkOrderId into the current
089: * instance of the class.
090: *
091: * @param _concreteWorkOrderId
092: * the ConcreteWorkOrderId to copy
093: */
094: protected void copy(final ConcreteWorkOrderId _concreteWorkOrderId) {
095: this .concretePredecessorId = _concreteWorkOrderId
096: .getConcretePredecessorId();
097: this .concreteSuccessorId = _concreteWorkOrderId
098: .getConcreteSuccessorId();
099: this .concreteLinkTypeId = _concreteWorkOrderId.concreteLinkTypeId;
100: }
101:
102: /**
103: * Returns the identifier of the concrete predecessor assigned to the
104: * ConcreteWorkOrderId
105: *
106: * @return the concretePredecessorId
107: */
108: public String getConcretePredecessorId() {
109: return this .concretePredecessorId;
110: }
111:
112: /**
113: * Sets the identifier of the concrete predecessor assigned to the
114: * ConcreteWorkOrderId
115: *
116: * @param _concretePredecessorId
117: * the concretePredecessorId to set
118: */
119: public void setConcretePredecessorId(String _concretePredecessorId) {
120: this .concretePredecessorId = _concretePredecessorId;
121: }
122:
123: /**
124: * Returns the identifier of the concrete successor assigned to the
125: * ConcreteWorkOrderId
126: *
127: * @return the concreteSuccessorId
128: */
129: public String getConcreteSuccessorId() {
130: return this .concreteSuccessorId;
131: }
132:
133: /**
134: * Sets the identifier of the concrete successor assigned to the
135: * ConcreteWorkOrderId
136: *
137: * @param _concreteSuccessorId
138: * the concreteSuccessorId to set
139: */
140: public void setConcreteSuccessorId(String _concreteSuccessorId) {
141: this .concreteSuccessorId = _concreteSuccessorId;
142: }
143:
144: /**
145: * Returns the identifier of the concrete link type assigned to the
146: * ConcreteWorkOrderId
147: *
148: * @return the linkType
149: */
150: public String getConcreteLinkTypeId() {
151: return concreteLinkTypeId;
152: }
153:
154: /**
155: * Sets the identifier of the concrete link type assigned to the
156: * ConcreteWorkOrderId
157: *
158: * @param _linkType the linkType to set
159: */
160: public void setConcreteLinkTypeId(String _linkType) {
161: concreteLinkTypeId = _linkType;
162: }
163: }
|