Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
private fun blockBuilder(initializeAction: BBInitializer.() -> Unit) {
val blockBuilderInitializer = BBInitializer()
val jsonResource = blockBuilderInitializer.jsonResource
?: throw NullPointerException("jsonResource must be set")
val remoteFileUrl = blockBuilderInitializer.remoteFileUrl
?: throw NullPointerException("remoteFileUrl must be set")
val context = blockBuilderInitializer.context
?: throw NullPointerException("context must be set")
.configuration(ConfigurationParameters(jsonResource, remoteFileUrl))
private class BBInitializer {
var context: Context? = null
var jsonResource: Int? = null
var remoteFileUrl: String? = null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment