kotlin code, the function
IntegrationModehow(a: String, b:Boolean)
do not accept null-able,
how to git ride of the using of double "bang":
var messagingService: String? = null //set later somewhere
var isAutoIntegration: Boolean? = null
......
if ( messagingService != null && isAutoIntegration != null) {
val theMode = IntegrationMode(builder.messagingService!!, builder.isAutoIntegration!!)
}
it could use nested let
:
messagingService?.let { messagingService ->
isAutoIntegration?.let { isAutoIntegration ->
val theMode = IntegrationMode(messagingService, isAutoIntegration)
}
}
but is there suggested way for this type null-able checking?