Subversion Repositories SmartDukaan

Rev

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

Rev 23780 Rev 32952
Line 1... Line 1...
1
package com.spice.profitmandi.common.enumuration;
1
package com.spice.profitmandi.common.enumuration;
2
 
2
 
3
public enum ItemType {
3
public enum ItemType {
4
	SERIALIZED, NON_SERIALIZED;
4
	SERIALIZED(1), NON_SERIALIZED(2);
-
 
5
 
-
 
6
	private final int value;
-
 
7
 
-
 
8
	private ItemType(int value) {
-
 
9
		this.value = value;
-
 
10
	}
-
 
11
 
-
 
12
	/**
-
 
13
	 * Get the integer value of this enum value, as defined in the Thrift IDL.
-
 
14
	 */
-
 
15
	public int getValue() {
-
 
16
		return value;
-
 
17
	}
-
 
18
 
-
 
19
	/**
-
 
20
	 * Find a the enum type by its integer value, as defined in the Thrift IDL.
-
 
21
	 * @return null if the value is not found.
-
 
22
	 */
-
 
23
	public static ItemType findByValue(int value) {
-
 
24
		switch (value) {
-
 
25
			case 1:
-
 
26
				return SERIALIZED;
-
 
27
			case 2:
-
 
28
				return NON_SERIALIZED;
-
 
29
			default:
-
 
30
				return null;
-
 
31
		}
-
 
32
	}
5
}
33
}