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.order;
6
 
7
 
8
import java.util.Map;
9
import java.util.HashMap;
10
 
11
public enum TransactionStatus {
12
  INIT(0),
13
  IN_PROCESS(1),
14
  COMPLETED(2),
15
  FAILED(3),
16
  AUTHORIZED(4),
17
  COD_IN_PROCESS(5),
18
  FLAGGED(6);
19
 
20
  private final int value;
21
 
22
  private TransactionStatus(int value) {
23
    this.value = value;
24
  }
25
 
26
  /**
27
   * Get the integer value of this enum value, as defined in the Thrift IDL.
28
   */
29
  public int getValue() {
30
    return value;
31
  }
32
 
33
  /**
34
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
35
   * @return null if the value is not found.
36
   */
37
  public static TransactionStatus findByValue(int value) { 
38
    switch (value) {
39
      case 0:
40
        return INIT;
41
      case 1:
42
        return IN_PROCESS;
43
      case 2:
44
        return COMPLETED;
45
      case 3:
46
        return FAILED;
47
      case 4:
48
        return AUTHORIZED;
49
      case 5:
50
        return COD_IN_PROCESS;
51
      case 6:
52
        return FLAGGED;
53
      default:
54
        return null;
55
    }
56
  }
57
}