Subversion Repositories SmartDukaan

Rev

Rev 26930 | Rev 31522 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26930 Rev 27797
Line 6... Line 6...
6
import java.util.List;
6
import java.util.List;
7
import java.util.Map;
7
import java.util.Map;
8
import java.util.stream.Collectors;
8
import java.util.stream.Collectors;
9
import java.util.stream.Stream;
9
import java.util.stream.Stream;
10
 
10
 
-
 
11
import org.apache.commons.collections.ArrayStack;
-
 
12
import org.apache.commons.collections4.list.UnmodifiableList;
-
 
13
 
-
 
14
import com.mysql.fabric.xmlrpc.base.Array;
-
 
15
 
11
public enum PartnerType {
16
public enum PartnerType {
12
	ALL("All"), PLATINUM("Platinum"), DIAMOND("Diamond"), GOLD("Gold"), SILVER("Silver"), BRONZE("Bronze"),
17
	ALL("All"), PLATINUM("Platinum"), DIAMOND("Diamond"), GOLD("Gold"), SILVER("Silver"), BRONZE("Bronze"),
13
	NEW("Rising Star");
18
	NEW("Rising Star");
-
 
19
 
14
	private static final List<PartnerType> partnerTypes = Arrays.asList(BRONZE, SILVER, GOLD, DIAMOND, PLATINUM);
20
	private static final List<PartnerType> partnerTypes = new UnmodifiableList<>(
-
 
21
			Arrays.asList(BRONZE, SILVER, GOLD, DIAMOND, PLATINUM));
15
 
22
 
16
	public static final Map<PartnerType, Integer> PartnerTypeRankMap = new HashMap<>();
23
	public static final Map<PartnerType, Integer> PartnerTypeRankMap = new HashMap<>();
17
 
24
 
18
	static {
25
	static {
19
		PartnerTypeRankMap.put(PartnerType.BRONZE, 1);
26
		PartnerTypeRankMap.put(PartnerType.BRONZE, 1);
Line 51... Line 58...
51
			return this;
58
			return this;
52
		} else {
59
		} else {
53
			return partnerTypes.get(index + 1);
60
			return partnerTypes.get(index + 1);
54
		}
61
		}
55
	}
62
	}
-
 
63
 
-
 
64
	public List<PartnerType> nextPartnerTypes() {
-
 
65
		if (this.equals(PartnerType.NEW))
-
 
66
			return Arrays.asList(this);
-
 
67
		int index = partnerTypes.indexOf(this);
-
 
68
		return partnerTypes.stream().skip(index + 1).collect(Collectors.toList());
-
 
69
 
-
 
70
	}
56
}
71
}