Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Replaced String concatenation with template #334

Open
wants to merge 1 commit into
base: adssched
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class IOSchedViewModelFactory @Inject constructor(
private val creators: @JvmSuppressWildcards Map<Class<out ViewModel>, Provider<ViewModel>>
) : ViewModelProvider.Factory {

override fun <T : ViewModel> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
val found = creators.entries.find { modelClass.isAssignableFrom(it.key) }
val creator = found?.value
?: throw IllegalArgumentException("unknown model class " + modelClass)
?: throw IllegalArgumentException("unknown model class $modelClass")
try {
@Suppress("UNCHECKED_CAST")
return creator.get() as T
Expand Down