Skip to main content
summaryrefslogtreecommitdiffstats
blob: e61c331b3ebf51e17002cf527627af8bd6dbae3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Created on Dec 15, 2010
 *
 * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
 */
package org.eclipse.osee.ats.core.workdef;

import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

public class AbstractWorkDefItem {

   private String name;
   protected String description;
   protected Map<String, String> workDataKeyValueMap = new HashMap<String, String>();
   private final Pattern keyValuePattern = Pattern.compile("^(.*?)=(.*)$", Pattern.MULTILINE | Pattern.DOTALL);

   public AbstractWorkDefItem(String name) {
      this.name = name;
   }

   public String getWorkDataValue(String key) {
      return workDataKeyValueMap.get(key);
   }

   public void addWorkDataKeyValue(String key, String value) {
      workDataKeyValueMap.put(key, value);
   }

   public String getName() {
      return name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public String getDescription() {
      return description;
   }

   public void setDescription(String description) {
      this.description = description;
   }

   public Pattern getKeyValuePattern() {
      return keyValuePattern;
   }

   public Map<String, String> getWorkDataKeyValueMap() {
      return workDataKeyValueMap;
   }

   @Override
   public String toString() {
      return getName();
   }
}

Back to the top