MTOfflinePackMetadata

@Serializable(with = MTOfflinePackMetadataSerializer::class)
data class MTOfflinePackMetadata(val id: String, var state: MTOfflinePackState, var size: Long, val createdAt: Instant, var expiresAt: Instant, val context: ByteArray? = null, val region: MTOfflineRegionDefinition, var totalResources: Int, var totalTileResources: Int, var downloadedResources: Int)

Metadata information about an offline pack.

This model is used to persist pack information such as its identifier, current state, total size, and creation date.

Constructors

constructor(id: String, state: MTOfflinePackState, size: Long, createdAt: Instant, expiresAt: Instant, context: ByteArray? = null, region: MTOfflineRegionDefinition, totalResources: Int, totalTileResources: Int, downloadedResources: Int)

Types

Properties

val context: ByteArray? = null

Optional custom data, typically used to store application-specific context (e.g. JSON data).

The date when the pack was created.

Number of resources that have been successfully downloaded.

The date when the pack expires.

val id: String

The unique identifier of the pack.

Returns true if the pack has passed its expiration date.

Returns true if the pack is beyond its grace period.

The region definition specifying the bounding box, zoom levels, and style.

var size: Long

The total size of the pack in bytes.

The current state of the pack.

Total number of resources required for the pack.

Total number of tile resources required for the pack.

Functions

open operator override fun equals(other: Any?): Boolean
open override fun hashCode(): Int
fun toJson(): String

Encodes this metadata to a JSON string.