]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionFlowDescriptor.java
d9a3e66574903db85a9e2f93fab95756b42e76d3
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / execution / ExecutionFlowDescriptor.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.execution;
18
19 import java.io.Serializable;
20 import java.util.Map;
21
22 /**
23 *
24 * @author bsinou
25 *
26 * This class implements the archetype of a given process.
27 *
28 * WARNING : for now both <code>values</code> and
29 * <code>executionSpec</code> which are rundundant are used. Should be
30 * improved in further version. Note also that a third redundant field,
31 * <code>RealizedFlow.executionSpec</code> is also to be cleaned.
32 *
33 */
34 public class ExecutionFlowDescriptor implements Serializable {
35 private static final long serialVersionUID = 7101944857038041216L;
36 private String name;
37 private String description;
38 private String path;
39 private Map<String, Object> values;
40 private ExecutionSpec executionSpec;
41
42 public ExecutionFlowDescriptor() {
43 }
44
45 public ExecutionFlowDescriptor(String name, Map<String, Object> values,
46 ExecutionSpec executionSpec) {
47 this.name = name;
48 this.values = values;
49 this.executionSpec = executionSpec;
50 }
51
52 public String getName() {
53 return name;
54 }
55
56 public String getPath() {
57 return path;
58 }
59
60 public void setPath(String path) {
61 this.path = path;
62 }
63
64 public Map<String, Object> getValues() {
65 return values;
66 }
67
68 public ExecutionSpec getExecutionSpec() {
69 return executionSpec;
70 }
71
72 public void setName(String name) {
73 this.name = name;
74 }
75
76 public void setValues(Map<String, Object> values) {
77 this.values = values;
78 }
79
80 public void setExecutionSpec(ExecutionSpec executionSpec) {
81 this.executionSpec = executionSpec;
82 }
83
84 public String getDescription() {
85 return description;
86 }
87
88 public void setDescription(String description) {
89 this.description = description;
90 }
91
92 @Override
93 public boolean equals(Object obj) {
94 if (obj instanceof ExecutionFlowDescriptor)
95 return name.equals(((ExecutionFlowDescriptor) obj).getName());
96 return false;
97 }
98
99 @Override
100 public int hashCode() {
101 return name.hashCode();
102 }
103
104 @Override
105 public String toString() {
106 return (path != null && !path.trim().equals("") ? path + "/" : "")
107 + name;
108 }
109
110 }