For {T185709}, we need to be able to serialize and deserialize `Context`s, so that they can afterwards be used to store the deserialized `CheckResults` into an array again. I assume this will have to be specific for the three context types we support, and each of them will serialize the data it needs, and then there’ll be some code somewhere that delegates to the correct one of the three subclasses for deserialization.
I’m not sure how this would look – non-static `serialize` and static `deserialize` methods on `Context` and its subclasses? Or should it be a separate kind of `ContextSerialization` service? I think my colleagues know more about this than me, there’s a lot of serialization going on in Wikibase ;)
---
- [ ] [add `ContextCursor` and implementations](https://gerrit.wikimedia.org/r/413773)
- [ ] [add `Context::getCursor()`](https://gerrit.wikimedia.org/r/413774)
- [ ] [remove `CheckResult::getEntityId()`](https://gerrit.wikimedia.org/r/413775)
- [ ] make `CheckResult` hold a `ContextCursor` instead of a `Context
- [ ] drop `Context::storeCheckResultInArray` and `ApiV2Context` (don’t forget to adjust `@covers` tags in tests!)