mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
these methods used in expressions like a = a + b, so they need to return NotNull when receiver is NotNull
29 lines
497 B
Java
29 lines
497 B
Java
import org.jetbrains.annotations.NotNull;
|
|
|
|
class JavaClass {
|
|
@NotNull JavaClass plus(Runnable i) {
|
|
i.run();
|
|
return this;
|
|
}
|
|
|
|
@NotNull JavaClass minus(Runnable i) {
|
|
i.run();
|
|
return this;
|
|
}
|
|
|
|
@NotNull JavaClass times(Runnable i) {
|
|
i.run();
|
|
return this;
|
|
}
|
|
|
|
@NotNull JavaClass div(Runnable i) {
|
|
i.run();
|
|
return this;
|
|
}
|
|
|
|
@NotNull JavaClass mod(Runnable i) {
|
|
i.run();
|
|
return this;
|
|
}
|
|
}
|