blob: 1fcb64074bf46d88e65b5ef40beb92895dd91316 [file] [log] [blame]
Stuart McCullochbb014372012-06-07 21:57:32 +00001package aQute.bnd.compatibility;
2
3import java.lang.reflect.*;
4
5/**
6 * Access modifier
7 */
8public 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 McCulloch55d4dfe2012-08-07 10:57:21 +000022 @Override
Stuart McCullochbb014372012-06-07 21:57:32 +000023 public String toString() {
24 return super.toString().toLowerCase();
25 }
26}