-
Notifications
You must be signed in to change notification settings - Fork 0
/
FunctionControlShift.java
53 lines (47 loc) · 1.64 KB
/
FunctionControlShift.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 FunctionControlShift {
FunctionControlInlineShift(Main.FUNCTION_CONTROL_INLINE_SHIFT),
FunctionControlDontInlineShift(Main.FUNCTION_CONTROL_DONT_INLINE_SHIFT),
FunctionControlPureShift(Main.FUNCTION_CONTROL_PURE_SHIFT),
FunctionControlConstShift(Main.FUNCTION_CONTROL_CONST_SHIFT),
FunctionControlMax(Main.FUNCTION_CONTROL_MAX);
private final int value;
private FunctionControlShift(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static FunctionControlShift valueByStr(String str) {
switch (str) {
case "FunctionControlInlineShift":
return FunctionControlInlineShift;
case "FunctionControlDontInlineShift":
return FunctionControlDontInlineShift;
case "FunctionControlPureShift":
return FunctionControlPureShift;
case "FunctionControlConstShift":
return FunctionControlConstShift;
case "FunctionControlMax":
return FunctionControlMax;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static FunctionControlShift valueByConstant(int constant) {
switch (constant) {
case Main.FUNCTION_CONTROL_INLINE_SHIFT:
return FunctionControlInlineShift;
case Main.FUNCTION_CONTROL_DONT_INLINE_SHIFT:
return FunctionControlDontInlineShift;
case Main.FUNCTION_CONTROL_PURE_SHIFT:
return FunctionControlPureShift;
case Main.FUNCTION_CONTROL_CONST_SHIFT:
return FunctionControlConstShift;
case Main.FUNCTION_CONTROL_MAX:
return FunctionControlMax;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}