Subversion Repositories SmartDukaan

Rev

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

Rev 1855 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.payments;
6
package in.shop2020.payments;
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 PaymentStatus implements TEnum{
13
public enum PaymentStatus implements org.apache.thrift.TEnum {
13
    INIT(0),
14
  INIT(0),
14
    PENDING(1),
15
  PENDING(1),
15
    SUCCESS(2),
16
  SUCCESS(2),
16
    FAILED(3),
17
  FAILED(3),
17
    AUTHORIZED(4);
18
  AUTHORIZED(4);
18
 
-
 
19
  private static final Map<Integer, PaymentStatus> BY_VALUE = new HashMap<Integer,PaymentStatus>() {{
-
 
20
    for(PaymentStatus val : PaymentStatus.values()) {
-
 
21
      put(val.getValue(), val);
-
 
22
    }
-
 
23
  }};
-
 
24
 
19
 
25
  private final int value;
20
  private final int value;
26
 
21
 
27
  private PaymentStatus(int value) {
22
  private PaymentStatus(int value) {
28
    this.value = value;
23
    this.value = value;
Line 38... Line 33...
38
  /**
33
  /**
39
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
34
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
40
   * @return null if the value is not found.
35
   * @return null if the value is not found.
41
   */
36
   */
42
  public static PaymentStatus findByValue(int value) { 
37
  public static PaymentStatus findByValue(int value) { 
-
 
38
    switch (value) {
-
 
39
      case 0:
-
 
40
        return INIT;
-
 
41
      case 1:
-
 
42
        return PENDING;
-
 
43
      case 2:
-
 
44
        return SUCCESS;
-
 
45
      case 3:
-
 
46
        return FAILED;
-
 
47
      case 4:
43
    return BY_VALUE.get(value);
48
        return AUTHORIZED;
-
 
49
      default:
-
 
50
        return null;
-
 
51
    }
44
  }
52
  }
45
}
53
}