Files
kotlin-fork/plugins/lombok/lombok-compiler-plugin/testData/compile/getters.kt
T
Andrey Zinovyev f71e08df4d [lombok] Experimental lombok plugin prototype
Add extension point for java descriptors
Add simple usage of this point to generate getter method
Add simple test infrastructure to test compilation with lombok plugin
2021-04-25 18:17:53 +03:00

39 lines
700 B
Kotlin
Vendored

//FILE: GetterTest.java
import lombok.AccessLevel;
import lombok.Getter;
public class GetterTest {
@Getter private int age = 10;
@Getter(AccessLevel.PROTECTED) private String name;
@Getter private boolean primitiveBoolean;
@Getter private Boolean boxedBoolean;
void test() {
getAge();
isPrimitiveBoolean();
}
}
//FILE: test.kt
object Test {
fun usage() {
val obj = GetterTest()
val getter = obj.getAge()
val property = obj.age
//todo kotlin doesn't see isBoolean methods as properties
// obj.primitiveBoolean
obj.isPrimitiveBoolean()
obj.boxedBoolean
obj.getBoxedBoolean()
}
}