Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 1 | package aQute.bnd.compatibility; |
| 2 | |
| 3 | import java.lang.reflect.*; |
| 4 | |
| 5 | /** |
| 6 | * Access modifier |
| 7 | */ |
| 8 | public enum Access { |
| 9 | PUBLIC, PROTECTED, PACKAGE, PRIVATE, UNKNOWN; |
| 10 | |
| 11 | public static Access modifier(int mod) { |
| 12 | if (Modifier.isPublic(mod)) |
| 13 | return PUBLIC; |
| 14 | if (Modifier.isProtected(mod)) |
| 15 | return PROTECTED; |
| 16 | if (Modifier.isPrivate(mod)) |
| 17 | return PRIVATE; |
| 18 | |
| 19 | return PACKAGE; |
| 20 | } |
| 21 | |
Stuart McCulloch | 55d4dfe | 2012-08-07 10:57:21 +0000 | [diff] [blame] | 22 | @Override |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 23 | public String toString() { |
| 24 | return super.toString().toLowerCase(); |
| 25 | } |
| 26 | } |