yperess
10/06/2017, 3:25 PMfun processResponse(res: Response) {
if (res.isSucceess()) {
updateUi(res.body)
}
}
fun updateUi(data: Data) {
}
class Response(val data: Data? = null) {
fun isSuccess(): Boolean {...}
}
In this example, I'd like to create a contract that Response.data
will never be null if isSuccess()
return true
. I can't seem to find anything (I assume it'd have to be an annotation) that would do this.