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