aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/javac/handlers/PKG.java
blob: 4622c3eee2ad422c403340df7767abcd90656f9d (plain)
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
package lombok.javac.handlers;

import java.lang.reflect.Modifier;

import javax.lang.model.element.Element;
import javax.lang.model.type.TypeKind;

import lombok.AccessLevel;
import lombok.core.TransformationsUtil;

class PKG {
	static String toGetterName(Element field) {
		CharSequence fieldName = field.getSimpleName();
		
		boolean isBoolean = field.asType().getKind() == TypeKind.BOOLEAN;
		
		return TransformationsUtil.toGetterName(fieldName, isBoolean);
	}
	
	static int toJavacModifier(AccessLevel accessLevel) {
		switch ( accessLevel ) {
		case MODULE:
		case PACKAGE:
			return 0;
		default:
		case PUBLIC:
			return Modifier.PUBLIC;
		case PRIVATE:
			return Modifier.PRIVATE;
		case PROTECTED:
			return Modifier.PROTECTED;
		}
	}
}