litesoft
Diff Revisions
939
vs
948
for /trunk/GWT_Sandbox/InitFrom/src/org/litesoft/initfrom/client/boviews/Role.java
|
@@ -3,8 +3,7 @@ |
3 |
3 |
|
import org.litesoft.commonfoundation.typeutils.*; |
4 |
4 |
|
import org.litesoft.core.util.*; |
5 |
5 |
|
|
6 |
|
- |
public enum Role |
7 |
|
- |
{ |
|
6 |
+ |
public enum Role { |
8 |
7 |
|
EndUser, |
9 |
8 |
|
EndUserManager, |
10 |
9 |
|
Developer, |
|
@@ -15,37 +14,29 @@ |
15 |
14 |
|
|
16 |
15 |
|
private int mBit = BITS.BIT.next(); |
17 |
16 |
|
|
18 |
|
- |
public int getBit() |
19 |
|
- |
{ |
|
17 |
+ |
public int getBit() { |
20 |
18 |
|
return mBit; |
21 |
19 |
|
} |
22 |
20 |
|
|
23 |
|
- |
public static int getBitFor( String pRole ) |
24 |
|
- |
{ |
25 |
|
- |
try |
26 |
|
- |
{ |
|
21 |
+ |
public static int getBitFor( String pRole ) { |
|
22 |
+ |
try { |
27 |
23 |
|
return valueOf( pRole ).getBit(); |
28 |
24 |
|
} |
29 |
|
- |
catch ( IllegalArgumentException e ) |
30 |
|
- |
{ |
|
25 |
+ |
catch ( IllegalArgumentException e ) { |
31 |
26 |
|
return BITS.BIT.none(); |
32 |
27 |
|
} |
33 |
28 |
|
} |
34 |
29 |
|
|
35 |
|
- |
public static Role valueFor( String pRole ) |
36 |
|
- |
{ |
37 |
|
- |
try |
38 |
|
- |
{ |
|
30 |
+ |
public static Role valueFor( String pRole ) { |
|
31 |
+ |
try { |
39 |
32 |
|
return valueOf( pRole ); |
40 |
33 |
|
} |
41 |
|
- |
catch ( IllegalArgumentException e ) |
42 |
|
- |
{ |
|
34 |
+ |
catch ( IllegalArgumentException e ) { |
43 |
35 |
|
return EndUser; |
44 |
36 |
|
} |
45 |
37 |
|
} |
46 |
38 |
|
|
47 |
|
- |
public static interface BITS |
48 |
|
- |
{ |
|
39 |
+ |
public static interface BITS { |
49 |
40 |
|
public static final BitFlag BIT = new BitFlag(); |
50 |
41 |
|
|
51 |
42 |
|
public static final int sAdminFlag = BIT.next(); |