Skip to content

Commit

Permalink
[Config] make the databaseholder method inline reified.
Browse files Browse the repository at this point in the history
  • Loading branch information
agrosner committed Feb 17, 2021
1 parent 209e682 commit 630cdbf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/src/main/kotlin/com/dbflow5/config/FlowConfig.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.dbflow5.config

import android.content.Context
import kotlin.reflect.KClass

/**
* Description: The main configuration instance for DBFlow. This
Expand Down Expand Up @@ -46,10 +45,7 @@ class FlowConfig(val context: Context,
databaseHolders.add(databaseHolderClass)
}

fun addDatabaseHolder(databaseHolderClass: KClass<out DatabaseHolder>) = apply {
databaseHolders.add(databaseHolderClass.java)
}

inline fun <reified T : DatabaseHolder> databaseHolder() = addDatabaseHolder(T::class.java)

fun database(databaseConfig: DatabaseConfig) = apply {
databaseConfigMap.put(databaseConfig.databaseClass, databaseConfig)
Expand Down

0 comments on commit 630cdbf

Please sign in to comment.