java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.state.ContextStateAccess

@Internal public final class ContextStateAccess extends Object
Resolver from a public ViewContext to its state backing; token impls never cast to concrete context classes, only to StateBackedContext. Public so token implementations outside this package (the pagination token) can run the shared owner/liveness guard via storeFor(ViewContext, View).
  • Method Details

    • storeFor

      @NotNull public static @NotNull StateStore storeFor(@NotNull @NotNull ViewContext context, @NotNull @NotNull View owner)
      Resolves the state store of a context after validating that the context belongs to the given owning view and is still open — the single guard shared by every per-context token implementation.
      Parameters:
      context - the context a token was invoked with
      owner - the view declaring the token
      Returns:
      the backing state store
      Throws:
      StaleContextException - when the context belongs to another view, is already closed, or carries no state backing