IssueActivityType.java

  1. /**
  2.  *
  3.  */
  4. package org.itracker.model;

  5. public enum IssueActivityType implements IntCodeEnum<IssueActivityType> {

  6.     ISSUE_CREATED(1),

  7.     STATUS_CHANGE(2),

  8.     OWNER_CHANGE(3),

  9.     SEVERITY_CHANGE(4),

  10.     COMPONENTS_MODIFIED(5),

  11.     VERSIONS_MODIFIED(6),

  12.     REMOVE_HISTORY(7),

  13.     ISSUE_MOVE(8),

  14.     SYSTEM_UPDATE(9),

  15.     TARGETVERSION_CHANGE(10),

  16.     DESCRIPTION_CHANGE(11),

  17.     RESOLUTION_CHANGE(12),

  18.     RELATION_ADDED(13),

  19.     RELATION_REMOVED(14),

  20.     ATTACHMENT_ADDED(15);

  21.     final Integer code;

  22.     private IssueActivityType(Integer code) {
  23.         this.code = code;
  24.     }

  25.     /**
  26.      * @deprecated
  27.      */
  28.     public static final IssueActivityType forCode(Integer type) {
  29.         return IssueActivityType.values()[0].fromCode(type);
  30.     }
  31.     public static final IssueActivityType valueOf(Integer type) {
  32.         return IssueActivityType.values()[0].fromCode(type);
  33.     }

  34.     public IssueActivityType fromCode(Integer code) {
  35.         for (IssueActivityType c : IssueActivityType.values()) {
  36.             if (c.getCode()== code) {
  37.                 return c;
  38.             }
  39.         }
  40.         return null;
  41.     }

  42.     public Integer getCode() {
  43.         return this.code;
  44.     }
  45. }