|
|
@ -190,6 +190,19 @@ data class BookSource( |
|
|
|
private fun equal(a: String?, b: String?) = a == b || (a.isNullOrEmpty() && b.isNullOrEmpty()) |
|
|
|
private fun equal(a: String?, b: String?) = a == b || (a.isNullOrEmpty() && b.isNullOrEmpty()) |
|
|
|
|
|
|
|
|
|
|
|
class Converters { |
|
|
|
class Converters { |
|
|
|
|
|
|
|
@TypeConverter |
|
|
|
|
|
|
|
fun loginRuleTString(loginRule: LoginRule?): String = GSON.toJson(loginRule) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TypeConverter |
|
|
|
|
|
|
|
fun stringToLoginRule(json: String?): LoginRule? { |
|
|
|
|
|
|
|
json ?: return null |
|
|
|
|
|
|
|
return if (json.isJsonObject()) { |
|
|
|
|
|
|
|
GSON.fromJsonObject(json) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
LoginRule(url = json) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@TypeConverter |
|
|
|
@TypeConverter |
|
|
|
fun exploreRuleToString(exploreRule: ExploreRule?): String = GSON.toJson(exploreRule) |
|
|
|
fun exploreRuleToString(exploreRule: ExploreRule?): String = GSON.toJson(exploreRule) |
|
|
|
|
|
|
|
|
|
|
|