Subversion Repositories SmartDukaan

Rev

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

Rev 1598 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.user;
6
package in.shop2020.model.v1.user;
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 UserType implements TEnum{
13
public enum UserType implements org.apache.thrift.TEnum {
13
    USER(0),
14
  USER(0),
14
    ANONYMOUS(1);
15
  ANONYMOUS(1);
15
 
-
 
16
  private static final Map<Integer, UserType> BY_VALUE = new HashMap<Integer,UserType>() {{
-
 
17
    for(UserType val : UserType.values()) {
-
 
18
      put(val.getValue(), val);
-
 
19
    }
-
 
20
  }};
-
 
21
 
16
 
22
  private final int value;
17
  private final int value;
23
 
18
 
24
  private UserType(int value) {
19
  private UserType(int value) {
25
    this.value = value;
20
    this.value = value;
Line 35... Line 30...
35
  /**
30
  /**
36
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
31
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
37
   * @return null if the value is not found.
32
   * @return null if the value is not found.
38
   */
33
   */
39
  public static UserType findByValue(int value) { 
34
  public static UserType findByValue(int value) { 
40
    return BY_VALUE.get(value);
35
    switch (value) {
-
 
36
      case 0:
-
 
37
        return USER;
-
 
38
      case 1:
-
 
39
        return ANONYMOUS;
-
 
40
      default:
-
 
41
        return null;
-
 
42
    }
41
  }
43
  }
42
}
44
}