View Javadoc
1   /**
2    *
3    */
4   package org.itracker.model;
5   
6   public enum IssueActivityType implements IntCodeEnum<IssueActivityType> {
7   
8       ISSUE_CREATED(1),
9   
10      STATUS_CHANGE(2),
11  
12      OWNER_CHANGE(3),
13  
14      SEVERITY_CHANGE(4),
15  
16      COMPONENTS_MODIFIED(5),
17  
18      VERSIONS_MODIFIED(6),
19  
20      REMOVE_HISTORY(7),
21  
22      ISSUE_MOVE(8),
23  
24      SYSTEM_UPDATE(9),
25  
26      TARGETVERSION_CHANGE(10),
27  
28      DESCRIPTION_CHANGE(11),
29  
30      RESOLUTION_CHANGE(12),
31  
32      RELATION_ADDED(13),
33  
34      RELATION_REMOVED(14),
35  
36      ATTACHMENT_ADDED(15);
37  
38      final Integer code;
39  
40      private IssueActivityType(Integer code) {
41          this.code = code;
42      }
43  
44      /**
45       * @deprecated
46       */
47      public static final IssueActivityType forCode(Integer type) {
48          return IssueActivityType.values()[0].fromCode(type);
49      }
50      public static final IssueActivityType valueOf(Integer type) {
51          return IssueActivityType.values()[0].fromCode(type);
52      }
53  
54      public IssueActivityType fromCode(Integer code) {
55          for (IssueActivityType c : IssueActivityType.values()) {
56              if (c.getCode()== code) {
57                  return c;
58              }
59          }
60          return null;
61      }
62  
63      public Integer getCode() {
64          return this.code;
65      }
66  }