Skip to main content
summaryrefslogtreecommitdiffstats
blob: c292f2666ed0475e97813eb70a09e40f1ef6a0f1 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*******************************************************************************
 * Copyright (c) 2004, 2007 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ats.core.type;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Donald G. Dunne
 */
public class ATSAttributes {
   private static final Map<String, ATSAttributes> WORK_ITEM_ID_TO_ATS_ATTRIBUTE_MAP =
      new HashMap<String, ATSAttributes>();

   // @formatter:off
   public static final ATSAttributes WORKING_BRANCH_WIDGET = new ATSAttributes("Working Branch");
   public static final ATSAttributes VALIDATE_REQ_CHANGES_WIDGET = new ATSAttributes("Validate Requirement Changes");
   public static final ATSAttributes CREATE_CODE_TEST_TASKS_OFF_REQUIREMENTS = new ATSAttributes("Create Code/Test Tasks");
   public static final ATSAttributes CHECK_SIGNALS_VIA_CDB_WIDGET = new ATSAttributes("Check Signals Via CDB");
   public static final ATSAttributes SHOW_CDB_DIFF_REPORT_WIDGET = new ATSAttributes("Show CDB Differences Report");
   public static final ATSAttributes COMMIT_MANAGER_WIDGET = new ATSAttributes("Commit Manager", "Commit branches to parent and parallel branches.");
   // @formatter:on

   private final String displayName;
   private final String description;
   private final String workItemId;

   protected ATSAttributes(String displayName, String workItemId, String description) {
      this.displayName = displayName;
      this.workItemId = workItemId;
      this.description = description;
      WORK_ITEM_ID_TO_ATS_ATTRIBUTE_MAP.put(workItemId, this);
   }

   private ATSAttributes(String displayName) {
      this(displayName, "");
   }

   private ATSAttributes(String displayName, String description) {
      this(displayName, "ats." + displayName, description);
   }

   public static ATSAttributes getAtsAttributeByStoreName(String workItemId) {
      return WORK_ITEM_ID_TO_ATS_ATTRIBUTE_MAP.get(workItemId);
   }

   @Override
   public final boolean equals(Object obj) {
      return super.equals(obj);
   }

   @Override
   public final int hashCode() {
      return super.hashCode();
   }

   public String getDisplayName() {
      return displayName;
   }

   public String getWorkItemId() {
      return workItemId;
   }

   public String getDescription() {
      return description;
   }
}

Back to the top