Subversion Repositories SmartDukaan

Rev

Rev 3061 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3061 Rev 3430
Line 1... Line 1...
1
/**
1
/**
2
 * Autogenerated by Thrift
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
5
 */
6
package in.shop2020.model.v1.order;
6
package in.shop2020.model.v1.order;
7
 
7
 
8
 
8
 
9
import java.util.Map;
9
import java.util.Map;
10
import java.util.HashMap;
10
import java.util.HashMap;
11
import org.apache.thrift.TEnum;
11
import org.apache.thrift.TEnum;
-
 
12
 
12
public enum TransactionStatus implements TEnum{
13
public enum TransactionStatus implements org.apache.thrift.TEnum {
13
    INIT(0),
14
  INIT(0),
14
    IN_PROCESS(1),
15
  IN_PROCESS(1),
15
    COMPLETED(2),
16
  COMPLETED(2),
16
    FAILED(3),
17
  FAILED(3),
17
    AUTHORIZED(4),
18
  AUTHORIZED(4),
18
    COD_IN_PROCESS(5);
19
  COD_IN_PROCESS(5);
19
 
-
 
20
  private static final Map<Integer, TransactionStatus> BY_VALUE = new HashMap<Integer,TransactionStatus>() {{
-
 
21
    for(TransactionStatus val : TransactionStatus.values()) {
-
 
22
      put(val.getValue(), val);
-
 
23
    }
-
 
24
  }};
-
 
25
 
20
 
26
  private final int value;
21
  private final int value;
27
 
22
 
28
  private TransactionStatus(int value) {
23
  private TransactionStatus(int value) {
29
    this.value = value;
24
    this.value = value;
Line 39... Line 34...
39
  /**
34
  /**
40
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
35
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
41
   * @return null if the value is not found.
36
   * @return null if the value is not found.
42
   */
37
   */
43
  public static TransactionStatus findByValue(int value) { 
38
  public static TransactionStatus findByValue(int value) { 
-
 
39
    switch (value) {
-
 
40
      case 0:
-
 
41
        return INIT;
-
 
42
      case 1:
44
    return BY_VALUE.get(value);
43
        return IN_PROCESS;
-
 
44
      case 2:
-
 
45
        return COMPLETED;
-
 
46
      case 3:
-
 
47
        return FAILED;
-
 
48
      case 4:
-
 
49
        return AUTHORIZED;
-
 
50
      case 5:
-
 
51
        return COD_IN_PROCESS;
-
 
52
      default:
-
 
53
        return null;
-
 
54
    }
45
  }
55
  }
46
}
56
}