Subversion Repositories SmartDukaan

Rev

Rev 1013 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1013 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.datalogger;
6
package in.shop2020.datalogger;
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 MsgType implements TEnum{
13
public enum MsgType implements org.apache.thrift.TEnum {
13
    REGISTER(0),
14
  REGISTER(0),
14
    LOGIN(1),
15
  LOGIN(1),
15
    LOGOUT(2),
16
  LOGOUT(2),
16
    ADD_TO_CART(3),
17
  ADD_TO_CART(3),
17
    CHECKOUT(4),
18
  CHECKOUT(4),
18
    PAYMENT(5);
19
  PAYMENT(5);
19
 
-
 
20
  private static final Map<Integer, MsgType> BY_VALUE = new HashMap<Integer,MsgType>() {{
-
 
21
    for(MsgType val : MsgType.values()) {
-
 
22
      put(val.getValue(), val);
-
 
23
    }
-
 
24
  }};
-
 
25
 
20
 
26
  private final int value;
21
  private final int value;
27
 
22
 
28
  private MsgType(int value) {
23
  private MsgType(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 MsgType findByValue(int value) { 
38
  public static MsgType findByValue(int value) { 
-
 
39
    switch (value) {
-
 
40
      case 0:
-
 
41
        return REGISTER;
-
 
42
      case 1:
-
 
43
        return LOGIN;
-
 
44
      case 2:
-
 
45
        return LOGOUT;
-
 
46
      case 3:
44
    return BY_VALUE.get(value);
47
        return ADD_TO_CART;
-
 
48
      case 4:
-
 
49
        return CHECKOUT;
-
 
50
      case 5:
-
 
51
        return PAYMENT;
-
 
52
      default:
-
 
53
        return null;
-
 
54
    }
45
  }
55
  }
46
}
56
}