Subversion Repositories SmartDukaan

Rev

Rev 31546 | 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 com.jcraft.jsch.Logger;
7
import org.apache.logging.log4j.LogManager;
8
 
27107 amit.gupta 9
import java.util.Arrays;
10
import java.util.List;
11
 
24407 govind 12
/**
13
 * @author govind
14
 *
15
 */
16
public enum EscalationType {
17
	L1("l1"),
18
	L2("l2"),
19
	L3("l3"),
27107 amit.gupta 20
	L4("l4"),
27112 amit.gupta 21
	L5("l5"),
22
	Final("final");
24407 govind 23
 
32795 amit.gupta 24
	private static final org.apache.logging.log4j.Logger LOGGER = LogManager.getLogger(EscalationType.class);
25
 
24407 govind 26
	private final String value;
27
 
31546 amit.gupta 28
	public static final List<EscalationType> escalations = Arrays.asList(EscalationType.L1, EscalationType.L2, EscalationType.L3, EscalationType.L4, EscalationType.L5, EscalationType.Final);
27107 amit.gupta 29
 
24407 govind 30
	private EscalationType(String value) {
31
		this.value = value;
32
	}
33
 
34
	public String getValue() {
35
		return value;
36
	}
27124 amit.gupta 37
	public EscalationType next() {
38
		if(EscalationType.Final.equals(this)) {
39
			return null;
27107 amit.gupta 40
		}
27124 amit.gupta 41
		return escalations.get(escalations.indexOf(this)+1);
27107 amit.gupta 42
	}
24407 govind 43
 
32795 amit.gupta 44
	public boolean isGreaterThanEqualTo(EscalationType escalationType) {
45
		LOGGER.info("{} >= {} ", escalations.indexOf(this), escalations.indexOf(escalationType));
46
		return escalations.indexOf(this) >= escalations.indexOf(escalationType);
47
	}
48
 
24407 govind 49
}