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