printAndReturn() added
This commit is contained in:
@@ -27,4 +27,12 @@ fun <T: Any> T?.sure(message: String): T {
|
||||
if (this == null)
|
||||
throw AssertionError(message)
|
||||
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