01: /*
02: * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
03: * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
04: *
05: * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
06: * General Public License as published by the Free Software Foundation; either version 2 of the License,
07: * or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
10: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public License along with this program; if not,
14: * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15: */
16:
17: package wilos.business.webservices.transfertobject;
18:
19: import java.io.Serializable;
20: import java.util.HashSet;
21: import java.util.Set;
22:
23: import wilos.model.spem2.checklist.CheckList;
24: import wilos.model.spem2.guide.Guidance;
25: import wilos.model.spem2.phase.Phase;
26:
27: public class PhaseTO extends Phase implements Serializable {
28:
29: /**
30: *
31: */
32: private static final long serialVersionUID = -4681548168470197482L;
33:
34: public PhaseTO() {
35: }
36:
37: public PhaseTO(Phase _phase) {
38: if (_phase != null) {
39: this .setDescription(_phase.getDescription());
40: this .setName(_phase.getName());
41: this .setGuid(_phase.getGuid());
42: this .setPresentationName(_phase.getPresentationName());
43:
44: this .setMainDescription(_phase.getMainDescription());
45: this .setKeyConsiderations(_phase.getKeyConsiderations());
46:
47: Set<Guidance> guidances = new HashSet<Guidance>();
48: for (Guidance g : _phase.getGuidances()) {
49: if (g instanceof CheckList)
50: guidances.add(new CheckListTO((CheckList) g));
51: else
52: guidances.add(new GuidanceTO(g));
53: }
54: this.setGuidances(guidances);
55: }
56: }
57:
58: }
|