-
Notifications
You must be signed in to change notification settings - Fork 0
/
EProfile.java
53 lines (47 loc) · 1.24 KB
/
EProfile.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.destranix.glslang;
public enum EProfile {
EBadProfile(Main.E_BAD_PROFILE),
ENoProfile(Main.E_NO_PROFILE),
ECoreProfile(Main.E_CORE_PROFILE),
ECompatibilityProfile(Main.E_COMPATIBILITY_PROFILE),
EEsProfile(Main.E_ES_PROFILE);
private final int value;
private EProfile(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static EProfile valueByStr(String str) {
switch (str) {
case "EBadProfile":
return EBadProfile;
case "ENoProfile":
return ENoProfile;
case "ECoreProfile":
return ECoreProfile;
case "ECompatibilityProfile":
return ECompatibilityProfile;
case "EEsProfile":
return EEsProfile;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static EProfile valueByConstant(int constant) {
switch (constant) {
case Main.E_BAD_PROFILE:
return EBadProfile;
case Main.E_NO_PROFILE:
return ENoProfile;
case Main.E_CORE_PROFILE:
return ECoreProfile;
case Main.E_COMPATIBILITY_PROFILE:
return ECompatibilityProfile;
case Main.E_ES_PROFILE:
return EEsProfile;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}