chore(deps): bump com.google.devtools.ksp from 1.9.25-1.0.20 to 2.1.21-2.0.1 (#412)
* chore(deps): bump com.google.devtools.ksp Bumps [com.google.devtools.ksp](https://github.com/google/ksp) from 1.9.25-1.0.20 to 2.1.21-2.0.1. - [Release notes](https://github.com/google/ksp/releases) - [Commits](https://github.com/google/ksp/compare/1.9.25-1.0.20...2.1.21-2.0.1) --- updated-dependencies: - dependency-name: com.google.devtools.ksp dependency-version: 2.1.21-2.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix: make value nullable --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Naveen Singh <36371707+naveensingh@users.noreply.github.com>
This commit is contained in:
parent
95f017a4f3
commit
826545838a
2 changed files with 13 additions and 5 deletions
|
|
@ -14,20 +14,28 @@ class Converters {
|
|||
private val messageAttachmentType = object : TypeToken<MessageAttachment?>() {}.type
|
||||
|
||||
@TypeConverter
|
||||
fun jsonToAttachmentList(value: String) = gson.fromJson<ArrayList<Attachment>>(value, attachmentType)
|
||||
fun jsonToAttachmentList(value: String?): ArrayList<Attachment>? {
|
||||
return gson.fromJson<ArrayList<Attachment>>(value, attachmentType)
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
fun attachmentListToJson(list: ArrayList<Attachment>) = gson.toJson(list)
|
||||
|
||||
@TypeConverter
|
||||
fun jsonToSimpleContactList(value: String) = gson.fromJson<ArrayList<SimpleContact>>(value, simpleContactType)
|
||||
fun jsonToSimpleContactList(value: String?): ArrayList<SimpleContact>? {
|
||||
return gson.fromJson<ArrayList<SimpleContact>>(value, simpleContactType)
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
fun simpleContactListToJson(list: ArrayList<SimpleContact>) = gson.toJson(list)
|
||||
|
||||
@TypeConverter
|
||||
fun jsonToMessageAttachment(value: String) = gson.fromJson<MessageAttachment>(value, messageAttachmentType)
|
||||
fun jsonToMessageAttachment(value: String): MessageAttachment? {
|
||||
return gson.fromJson<MessageAttachment>(value, messageAttachmentType)
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
fun messageAttachmentToJson(messageAttachment: MessageAttachment?) = gson.toJson(messageAttachment)
|
||||
fun messageAttachmentToJson(messageAttachment: MessageAttachment?): String? {
|
||||
return gson.toJson(messageAttachment)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue