Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
36619 amit 1
/**
2
 * Migrated from ThriftConfig - Thrift dependency removed
3
 *
4
 */
5
package in.shop2020.model.v1.user;
6
 
7
 
8
import java.util.Map;
9
import java.util.HashMap;
10
 
11
public enum CartStatus {
12
  ACTIVE(0),
13
  INACTIVE(1),
14
  EXPIRED(2),
15
  COMMITTED(3),
16
  COMMIT_FAILED(4);
17
 
18
  private final int value;
19
 
20
  private CartStatus(int value) {
21
    this.value = value;
22
  }
23
 
24
  /**
25
   * Get the integer value of this enum value, as defined in the Thrift IDL.
26
   */
27
  public int getValue() {
28
    return value;
29
  }
30
 
31
  /**
32
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
33
   * @return null if the value is not found.
34
   */
35
  public static CartStatus findByValue(int value) { 
36
    switch (value) {
37
      case 0:
38
        return ACTIVE;
39
      case 1:
40
        return INACTIVE;
41
      case 2:
42
        return EXPIRED;
43
      case 3:
44
        return COMMITTED;
45
      case 4:
46
        return COMMIT_FAILED;
47
      default:
48
        return null;
49
    }
50
  }
51
}