Interface NaruCacheAwareRequestSerializer
- All Superinterfaces:
NaruModelRequestSerializer
Extending NaruModelRequestSerializer rather than replacing it keeps
every existing serializer compiling untouched: providers that cache
automatically need no implementation at all, and a
NONE-capability provider keeps the exact body it produced before.
-
Method Summary
Modifier and TypeMethodDescriptiondefault NElementserialize(NaruModelRequest request, NaruModelConfig model, NaruSession session) serialize(NaruModelRequest request, NaruModelConfig model, NaruSession session, NaruCachePlanView plan) Serialize with a resolved caching plan.default NElementserialize(NaruModelRequest request, NaruModelConfig model, NaruSession session, NaruCachePlanView plan, boolean stream) Serialise a streamed request with a resolved caching plan.Methods inherited from interface net.thevpc.naru.api.model.NaruModelRequestSerializer
serialize
-
Method Details
-
serialize
NElement serialize(NaruModelRequest request, NaruModelConfig model, NaruSession session, NaruCachePlanView plan) Serialize with a resolved caching plan.A plan is always passed, including for a full miss — "no markers anywhere" is a meaningful plan, and representing it as
nullwould make it indistinguishable from a provider that forgot to opt in. -
serialize
default NElement serialize(NaruModelRequest request, NaruModelConfig model, NaruSession session, NaruCachePlanView plan, boolean stream) Serialise a streamed request with a resolved caching plan.The two concerns are independent -- where a cache breakpoint lands has nothing to do with whether the response arrives progressively -- so a serializer that cares about one can keep ignoring the other. The default drops the flag, which is right for a provider whose caching markers and streaming flag never interact.
-
serialize
- Specified by:
serializein interfaceNaruModelRequestSerializer
-