printAndReturn() added
This commit is contained in:
@@ -28,3 +28,11 @@ fun <T: Any> T?.sure(message: String): T {
|
|||||||
throw AssertionError(message)
|
throw AssertionError(message)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun <T> T.printAndReturn(message: String = ""): T {
|
||||||
|
if (!message.isEmpty()) {
|
||||||
|
println("$message:")
|
||||||
|
}
|
||||||
|
println(this)
|
||||||
|
return this
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user