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 RechargeOrderStatus {
12
  PAYMENT_PENDING(1),
13
  PAYMENT_FAILED(2),
14
  PAYMENT_SUCCESSFUL(3),
15
  RECHARGE_FAILED(4),
16
  RECHARGE_SUCCESSFUL(5),
17
  RECHARGE_FAILED_REFUNDED(6),
18
  REFUNDED(7),
19
  PARTIALLY_REFUNDED(8),
20
  INIT(9),
21
  RECHARGE_UNKNOWN(10),
22
  RECHARGE_IN_PROCESS(11);
23
 
24
  private final int value;
25
 
26
  private RechargeOrderStatus(int value) {
27
    this.value = value;
28
  }
29
 
30
  /**
31
   * Get the integer value of this enum value, as defined in the Thrift IDL.
32
   */
33
  public int getValue() {
34
    return value;
35
  }
36
 
37
  /**
38
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
39
   * @return null if the value is not found.
40
   */
41
  public static RechargeOrderStatus findByValue(int value) { 
42
    switch (value) {
43
      case 1:
44
        return PAYMENT_PENDING;
45
      case 2:
46
        return PAYMENT_FAILED;
47
      case 3:
48
        return PAYMENT_SUCCESSFUL;
49
      case 4:
50
        return RECHARGE_FAILED;
51
      case 5:
52
        return RECHARGE_SUCCESSFUL;
53
      case 6:
54
        return RECHARGE_FAILED_REFUNDED;
55
      case 7:
56
        return REFUNDED;
57
      case 8:
58
        return PARTIALLY_REFUNDED;
59
      case 9:
60
        return INIT;
61
      case 10:
62
        return RECHARGE_UNKNOWN;
63
      case 11:
64
        return RECHARGE_IN_PROCESS;
65
      default:
66
        return null;
67
    }
68
  }
69
}