Subversion Repositories SmartDukaan

Rev

Rev 32795 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
24407 govind 1
/**
2
 * 
3
 */
4
package com.spice.profitmandi.dao.enumuration.cs;
5
 
32795 amit.gupta 6
import org.apache.logging.log4j.LogManager;
7
 
27107 amit.gupta 8
import java.util.Arrays;
9
import java.util.List;
10
 
24407 govind 11
/**
12
 * @author govind
13
 *
14
 */
15
public enum EscalationType {
16
	L1("l1"),
17
	L2("l2"),
18
	L3("l3"),
27107 amit.gupta 19
	L4("l4"),
27112 amit.gupta 20
	L5("l5"),
37145 ranu 21
	L6("l6"),
22
	L7("l7"),
23
	L8("l8"),
24
	L9("l9"),
27112 amit.gupta 25
	Final("final");
24407 govind 26
 
32795 amit.gupta 27
	private static final org.apache.logging.log4j.Logger LOGGER = LogManager.getLogger(EscalationType.class);
28
 
24407 govind 29
	private final String value;
30
 
37145 ranu 31
	public static final List<EscalationType> escalations = Arrays.asList(EscalationType.L1, EscalationType.L2, EscalationType.L3, EscalationType.L4, EscalationType.L5, EscalationType.L6, EscalationType.L7, EscalationType.L8, EscalationType.L9, EscalationType.Final);
27107 amit.gupta 32
 
24407 govind 33
	private EscalationType(String value) {
34
		this.value = value;
35
	}
36
 
37
	public String getValue() {
38
		return value;
39
	}
27124 amit.gupta 40
	public EscalationType next() {
41
		if(EscalationType.Final.equals(this)) {
42
			return null;
27107 amit.gupta 43
		}
27124 amit.gupta 44
		return escalations.get(escalations.indexOf(this)+1);
27107 amit.gupta 45
	}
24407 govind 46
 
32795 amit.gupta 47
	public boolean isGreaterThanEqualTo(EscalationType escalationType) {
48
		LOGGER.info("{} >= {} ", escalations.indexOf(this), escalations.indexOf(escalationType));
49
		return escalations.indexOf(this) >= escalations.indexOf(escalationType);
50
	}
51
 
24407 govind 52
}