String?, dark: String? ): ImageUrl? { return if (light == null) { null } else if (dark == null) { null } else { ImageUrl(light, dark) } } } companion object { fun create( light: String?, dark: String? ): ImageUrl? { return when { light == null -> null dark == null -> null else -> ImageUrl(light, dark) } } } Kotlin