Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
36619 amit 1
/**
2
 * Migrated from ThriftConfig - Thrift dependency removed
3
 *
4
 */
5
package in.shop2020.purchase;
6
 
7
 
8
import java.util.Map;
9
import java.util.HashMap;
10
 
11
public enum POStatus {
12
  INIT(0),
13
  READY(1),
14
  PARTIALLY_FULFILLED(2),
15
  PRECLOSED(3),
16
  CLOSED(4);
17
 
18
  private final int value;
19
 
20
  private POStatus(int value) {
21
    this.value = value;
22
  }
23
 
24
  /**
25
   * Get the integer value of this enum value, as defined in the Thrift IDL.
26
   */
27
  public int getValue() {
28
    return value;
29
  }
30
 
31
  /**
32
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
33
   * @return null if the value is not found.
34
   */
35
  public static POStatus findByValue(int value) { 
36
    switch (value) {
37
      case 0:
38
        return INIT;
39
      case 1:
40
        return READY;
41
      case 2:
42
        return PARTIALLY_FULFILLED;
43
      case 3:
44
        return PRECLOSED;
45
      case 4:
46
        return CLOSED;
47
      default:
48
        return null;
49
    }
50
  }
51
}