Newer
Older
DevRealm / app / src / main / java / jackall / devrealm / db / BaseRealmHelper.kt
MatsumotoKeiju on 8 Nov 2017 376 bytes [add] BaseRealmHelper
package jackall.devrealm.db

import io.realm.Realm
import io.realm.RealmModel
import io.realm.RealmResults

/**
 * Created by matsumoto_k on 2017/11/08.
 */
abstract class BaseRealmHelper<T : RealmModel> {
    val realm by lazy { Realm.getDefaultInstance() }
    abstract fun insert(realmObject: T)
    abstract fun findAll(): RealmResults<T>
    fun close() = realm.close()
}