diff options
Diffstat (limited to 'src/lombok/eclipse/handlers/PKG.java')
-rw-r--r-- | src/lombok/eclipse/handlers/PKG.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/lombok/eclipse/handlers/PKG.java b/src/lombok/eclipse/handlers/PKG.java new file mode 100644 index 00000000..61f71140 --- /dev/null +++ b/src/lombok/eclipse/handlers/PKG.java @@ -0,0 +1,36 @@ +package lombok.eclipse.handlers; + +import java.lang.reflect.Modifier; + +import lombok.AccessLevel; + +class PKG { + private PKG() {} + + static int toModifier(AccessLevel value) { + switch ( value ) { + case MODULE: + case PACKAGE: + return 0; + default: + case PUBLIC: + return Modifier.PUBLIC; + case PROTECTED: + return Modifier.PROTECTED; + case PRIVATE: + return Modifier.PRIVATE; + } + } + + static boolean nameEquals(char[][] typeName, String string) { + StringBuilder sb = new StringBuilder(); + boolean first = true; + for ( char[] elem : typeName ) { + if ( first ) first = false; + else sb.append('.'); + sb.append(elem); + } + + return string.contentEquals(sb); + } +} |