Subversion Repositories SmartDukaan

Rev

Rev 31262 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
31259 tejbeer 1
package com.spice.profitmandi.dao.enumuration.fofo;
2
 
3
public enum Milestone {
4
 
5
	ABOVE_TEN_LAC("> 10 Lac"), FOUR_TO_TEN_LAC("4Lac to 10Lac"), THREE_TO_FOUR_LAC("3Lac to 4Lac"),
6
	TWO_TO_THREE_LAC("2Lac to 3Lac"), LESS_THAN_TWO_LAC("< 2 Lac"), ZERO("0");
7
 
8
	private String value;
9
 
10
	private Milestone(String value) {
11
		this.value = value;
12
	}
13
 
14
	public String getValue() {
15
		return value;
16
	}
17
 
18
	public static Milestone get(int value) {
19
		Milestone milestone = null;
20
 
21
		if (value >= 1000000) {
22
			milestone = Milestone.ABOVE_TEN_LAC;
23
 
24
		} else if (value >= 400000 && value < 1000000) {
25
			milestone = Milestone.FOUR_TO_TEN_LAC;
26
 
27
		} else if (value >= 300000 && value < 400000) {
28
			milestone = Milestone.THREE_TO_FOUR_LAC;
29
 
30
		} else if (value >= 200000 && value < 300000) {
31
			milestone = Milestone.TWO_TO_THREE_LAC;
32
 
33
		} else if (value < 200000) {
34
			milestone = Milestone.LESS_THAN_TWO_LAC;
35
 
36
		} else if (value == 0) {
37
			milestone = Milestone.ZERO;
38
		}
39
 
40
		return milestone;
41
 
42
	}
43
}