Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3850 chandransh 1
package in.shop2020.catalog.dashboard.shared;
2
 
3
public enum ItemStatus {
4
    PHASED_OUT(0),
5
    DELETED(1),
6
    PAUSED(2),
7
    ACTIVE(3),
8
    IN_PROCESS(4),
9
    CONTENT_COMPLETE(5),
10
    PAUSED_BY_RISK(6);
11
 
12
    private final int value;
13
 
14
    private ItemStatus(int value) {
15
      this.value = value;
16
    }
17
 
18
    /**
19
     * Get the integer value of this enum value, as defined in the Thrift IDL.
20
     */
21
    public int getValue() {
22
      return value;
23
    }
24
 
25
    /**
26
     * Find a the enum type by its integer value, as defined in the Thrift IDL.
27
     * @return null if the value is not found.
28
     */
29
    public static ItemStatus findByValue(int value) { 
30
      switch (value) {
31
        case 0:
32
          return PHASED_OUT;
33
        case 1:
34
          return DELETED;
35
        case 2:
36
          return PAUSED;
37
        case 3:
38
          return ACTIVE;
39
        case 4:
40
          return IN_PROCESS;
41
        case 5:
42
          return CONTENT_COMPLETE;
43
        case 6:
44
          return PAUSED_BY_RISK;
45
        default:
46
          return null;
47
      }
48
    }
49
}