android-components / mozilla.components.browser.session.storage / SnapshotSerializer

SnapshotSerializer

class SnapshotSerializer (source)

Helper to transform SessionManager.Snapshot instances to JSON and back.

Parameters

restoreSessionIds - If true the original Session.id of Sessions will be restored. Otherwise a new ID will be generated. An app may prefer to use new IDs if it expects sessions to get restored multiple times - otherwise breaking the promise of a unique ID.

Constructors

Name Summary
<init> SnapshotSerializer(restoreSessionIds: Boolean = true)
Helper to transform SessionManager.Snapshot instances to JSON and back.

Functions

Name Summary
fromJSON fun fromJSON(engine: Engine, json: String): Snapshot
itemFromJSON fun itemFromJSON(engine: Engine, json: <ERROR CLASS>): Item
itemToJSON fun itemToJSON(item: Item): <ERROR CLASS>
toJSON fun toJSON(snapshot: Snapshot): String