fix: Objectのデイシリアライズに失敗したときnullを返すように

This commit is contained in:
usbharu 2023-12-22 16:23:18 +09:00
parent 87cd172165
commit bed0b84d16
1 changed files with 42 additions and 42 deletions

View File

@ -26,69 +26,69 @@ class ObjectDeserializer : JsonDeserializer<Object>() {
} else if (type.isValueNode) {
ExtendedActivityVocabulary.values().firstOrNull() { it.name.equals(type.asText(), true) }
} else {
TODO()
null
}
return when (activityType) {
ExtendedActivityVocabulary.Follow -> p.codec.treeToValue(treeNode, Follow::class.java)
ExtendedActivityVocabulary.Note -> p.codec.treeToValue(treeNode, Note::class.java)
ExtendedActivityVocabulary.Object -> p.codec.treeToValue(treeNode, Object::class.java)
ExtendedActivityVocabulary.Link -> TODO()
ExtendedActivityVocabulary.Activity -> TODO()
ExtendedActivityVocabulary.IntransitiveActivity -> TODO()
ExtendedActivityVocabulary.Collection -> TODO()
ExtendedActivityVocabulary.OrderedCollection -> TODO()
ExtendedActivityVocabulary.CollectionPage -> TODO()
ExtendedActivityVocabulary.OrderedCollectionPage -> TODO()
ExtendedActivityVocabulary.Link -> null
ExtendedActivityVocabulary.Activity -> null
ExtendedActivityVocabulary.IntransitiveActivity -> null
ExtendedActivityVocabulary.Collection -> null
ExtendedActivityVocabulary.OrderedCollection -> null
ExtendedActivityVocabulary.CollectionPage -> null
ExtendedActivityVocabulary.OrderedCollectionPage -> null
ExtendedActivityVocabulary.Accept -> p.codec.treeToValue(treeNode, Accept::class.java)
ExtendedActivityVocabulary.Add -> TODO()
ExtendedActivityVocabulary.Announce -> TODO()
ExtendedActivityVocabulary.Arrive -> TODO()
ExtendedActivityVocabulary.Add -> null
ExtendedActivityVocabulary.Announce -> null
ExtendedActivityVocabulary.Arrive -> null
ExtendedActivityVocabulary.Block -> p.codec.treeToValue(treeNode, Block::class.java)
ExtendedActivityVocabulary.Create -> p.codec.treeToValue(treeNode, Create::class.java)
ExtendedActivityVocabulary.Delete -> p.codec.treeToValue(treeNode, Delete::class.java)
ExtendedActivityVocabulary.Dislike -> TODO()
ExtendedActivityVocabulary.Flag -> TODO()
ExtendedActivityVocabulary.Ignore -> TODO()
ExtendedActivityVocabulary.Invite -> TODO()
ExtendedActivityVocabulary.Join -> TODO()
ExtendedActivityVocabulary.Leave -> TODO()
ExtendedActivityVocabulary.Dislike -> null
ExtendedActivityVocabulary.Flag -> null
ExtendedActivityVocabulary.Ignore -> null
ExtendedActivityVocabulary.Invite -> null
ExtendedActivityVocabulary.Join -> null
ExtendedActivityVocabulary.Leave -> null
ExtendedActivityVocabulary.Like -> p.codec.treeToValue(treeNode, Like::class.java)
ExtendedActivityVocabulary.Listen -> TODO()
ExtendedActivityVocabulary.Move -> TODO()
ExtendedActivityVocabulary.Offer -> TODO()
ExtendedActivityVocabulary.Question -> TODO()
ExtendedActivityVocabulary.Listen -> null
ExtendedActivityVocabulary.Move -> null
ExtendedActivityVocabulary.Offer -> null
ExtendedActivityVocabulary.Question -> null
ExtendedActivityVocabulary.Reject -> p.codec.treeToValue(treeNode, Reject::class.java)
ExtendedActivityVocabulary.Read -> TODO()
ExtendedActivityVocabulary.Remove -> TODO()
ExtendedActivityVocabulary.TentativeReject -> TODO()
ExtendedActivityVocabulary.TentativeAccept -> TODO()
ExtendedActivityVocabulary.Travel -> TODO()
ExtendedActivityVocabulary.Read -> null
ExtendedActivityVocabulary.Remove -> null
ExtendedActivityVocabulary.TentativeReject -> null
ExtendedActivityVocabulary.TentativeAccept -> null
ExtendedActivityVocabulary.Travel -> null
ExtendedActivityVocabulary.Undo -> p.codec.treeToValue(treeNode, Undo::class.java)
ExtendedActivityVocabulary.Update -> TODO()
ExtendedActivityVocabulary.View -> TODO()
ExtendedActivityVocabulary.Application -> TODO()
ExtendedActivityVocabulary.Group -> TODO()
ExtendedActivityVocabulary.Organization -> TODO()
ExtendedActivityVocabulary.Update -> null
ExtendedActivityVocabulary.View -> null
ExtendedActivityVocabulary.Application -> null
ExtendedActivityVocabulary.Group -> null
ExtendedActivityVocabulary.Organization -> null
ExtendedActivityVocabulary.Person -> p.codec.treeToValue(treeNode, Person::class.java)
ExtendedActivityVocabulary.Service -> TODO()
ExtendedActivityVocabulary.Article -> TODO()
ExtendedActivityVocabulary.Audio -> TODO()
ExtendedActivityVocabulary.Service -> null
ExtendedActivityVocabulary.Article -> null
ExtendedActivityVocabulary.Audio -> null
ExtendedActivityVocabulary.Document -> p.codec.treeToValue(treeNode, Document::class.java)
ExtendedActivityVocabulary.Event -> TODO()
ExtendedActivityVocabulary.Event -> null
ExtendedActivityVocabulary.Image -> p.codec.treeToValue(treeNode, Image::class.java)
ExtendedActivityVocabulary.Page -> TODO()
ExtendedActivityVocabulary.Place -> TODO()
ExtendedActivityVocabulary.Profile -> TODO()
ExtendedActivityVocabulary.Relationship -> TODO()
ExtendedActivityVocabulary.Page -> null
ExtendedActivityVocabulary.Place -> null
ExtendedActivityVocabulary.Profile -> null
ExtendedActivityVocabulary.Relationship -> null
ExtendedActivityVocabulary.Tombstone -> p.codec.treeToValue(treeNode, Tombstone::class.java)
ExtendedActivityVocabulary.Video -> TODO()
ExtendedActivityVocabulary.Mention -> TODO()
ExtendedActivityVocabulary.Video -> null
ExtendedActivityVocabulary.Mention -> null
ExtendedActivityVocabulary.Emoji -> p.codec.treeToValue(treeNode, Emoji::class.java)
null -> null
}
} else {
TODO()
return null
}
}
}