An overview how to realize code generation of languages on the JVM that implement other class layouts than the Java programming languages. As an example, the inline-mock-maker for Mockito is discussed which supports languages like Kotlin that make any property final by default.
7. class Sample {
var value: String? = null
fun getValue() = value
fun setValue(x: String?) {
this.value = x
}
}
final class Sample {
String value;
final String getValue() {
return value;
}
final void setValue(String x) {
this.value = x;
}
}
8. open class Sample {
var value: String? = null
open fun getValue() = value
open fun setValue(x: String?) {
this.value = x
}
}
class Sample {
String value;
String getValue() {
return value;
}
void setValue(String x) {
this.value = x;
}
}