Mohammadsss1
06/01/2019, 1:58 AMdimsuz
06/03/2019, 5:23 PMalec
06/03/2019, 5:52 PMjw
06/05/2019, 1:17 PMdave08
06/05/2019, 1:23 PMansman
06/05/2019, 1:27 PMansman
06/05/2019, 1:30 PMansman
06/05/2019, 1:35 PMdave08
06/05/2019, 1:39 PMjw
06/05/2019, 1:40 PMdave08
06/05/2019, 1:41 PMjw
06/05/2019, 1:41 PMjw
06/05/2019, 1:42 PMansman
06/05/2019, 1:43 PMjw
06/05/2019, 6:39 PMyshrsmz
06/07/2019, 6:45 AMjeremy
06/08/2019, 5:29 PMleosan
06/11/2019, 1:48 PMsealed class PaymentMethod
sealed class CreditCard : PaymentMethod()
data class Card(val field:String): CreditCard()
data class UntokenizedCard(val field:String,val field2String): CreditCard()
// How to parse this request to accept either Card/ UntokenizedCard objects
data class RetrofitRequest(something:Something)
I tried to write one but not sure if I fully understand how to parse to become either
"credit-card" : {
"cvc-code" : "999",
"expiration-date" : "12/2019",
"number" : "1234 1234 1234 1234",
"type" : "VISA"
}
or
"credit-card" : {
"identifier": "AAAA"
"cvc-code" : "999"
}
eric
06/11/2019, 2:19 PMleosan
06/11/2019, 2:21 PMleosan
06/11/2019, 3:02 PMclass PaymentMethodAdapter : JsonAdapter.Factory {
override fun create(type: Type, annotations: MutableSet<out Annotation>, moshi: Moshi): JsonAdapter<*>? {
if (!Types.getRawType(type).isAssignableFrom(PaymentMethod::class.java)) {
return null
}
return object: JsonAdapter<PaymentMethod>() {
private val tokenizedCardAdapter = moshi.adapter<TokenizedCard>(TokenizedCard::class.java)
private val unregisteredCardAdapter = moshi.adapter<UnregisteredCard>(UnregisteredCard::class.java)
override fun toJson(jsonWriter: JsonWriter, value: PaymentMethod?) {
requireNotNull(value)
when (value) {
is TokenizedCard -> { tokenizedCardAdapter.toJson(jsonWriter,value) }
is UnregisteredCard -> { unregisteredCardAdapter.toJson(jsonWriter,value) }
}
}
override fun fromJson(reader: JsonReader): PaymentMethod? {
TODO()
}
}
}
}
kevin.cianfarini
06/11/2019, 11:17 PMsuspend
main safe?jw
06/11/2019, 11:18 PMNikky
06/12/2019, 10:10 AMdata class A (
list: ListOf(B)
)
data class B ( ... )
is there any pssibility to use a ColumnAdapter to do joins automatically ?
seems like i need the tables A, B and ListOfB correct ?Nikky
06/12/2019, 11:53 AMid INTEGER AS Int PRIMARY KEY NOT NULL
takes id: Int?
, that seems brokenalec
06/12/2019, 12:30 PMINSERT INTO table VALUES ?
Nikky
06/12/2019, 5:31 PMFOREIGN KEY
here: https://www.techonthenet.com/sqlite/foreign_keys/foreign_keys.php
that seems to break in sqldelight, is that expected or should i file a issue ?alec
06/12/2019, 5:32 PMalec
06/12/2019, 5:32 PMNikky
06/12/2019, 5:33 PM