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.model.v1.catalog;
6
 
7
 
8
import java.util.Map;
9
import java.util.HashMap;
10
 
11
public enum ItemCondition {
12
  DAMAGED(0),
13
  DEFECTIVE(1);
14
 
15
  private final int value;
16
 
17
  private ItemCondition(int value) {
18
    this.value = value;
19
  }
20
 
21
  /**
22
   * Get the integer value of this enum value, as defined in the Thrift IDL.
23
   */
24
  public int getValue() {
25
    return value;
26
  }
27
 
28
  /**
29
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
30
   * @return null if the value is not found.
31
   */
32
  public static ItemCondition findByValue(int value) { 
33
    switch (value) {
34
      case 0:
35
        return DAMAGED;
36
      case 1:
37
        return DEFECTIVE;
38
      default:
39
        return null;
40
    }
41
  }
42
}