Message

data class Message @JvmOverloads constructor(val id: String = UUID.randomUUID().toString(), val piuri: String, val from: DID? = null, val to: DID? = null, val fromPrior: String? = null, val body: String, val extraHeaders: Map<String, String> = emptyMap(), val createdTime: String = Clock.System.now().epochSeconds.toString(), val expiresTimePlus: String = Clock.System.now().plus(1.days).epochSeconds.toString(), val attachments: Array<AttachmentDescriptor> = arrayOf(), val thid: String? = null, val pthid: String? = null, val ack: Array<String>? = emptyArray(), val direction: Message.Direction = Direction.RECEIVED)(source)

The Message data class represents a DIDComm message, which is used for secure, decentralized communication in the Atala PRISM architecture. A Message object includes information about the sender, recipient, message body, and other metadata. Message objects are typically exchanged between DID controllers using the Mercury building block.

Constructors

Link copied to clipboard
constructor(id: String = UUID.randomUUID().toString(), piuri: String, from: DID? = null, to: DID? = null, fromPrior: String? = null, body: String, extraHeaders: Map<String, String> = emptyMap(), createdTime: String = Clock.System.now().epochSeconds.toString(), expiresTimePlus: String = Clock.System.now().plus(1.days).epochSeconds.toString(), attachments: Array<AttachmentDescriptor> = arrayOf(), thid: String? = null, pthid: String? = null, ack: Array<String>? = emptyArray(), direction: Message.Direction = Direction.RECEIVED)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Enumeration representing the direction of a message.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "created_time")
val createdTime: String
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "expires_time_plus")
val expiresTimePlus: String
Link copied to clipboard
@SerialName(value = "extra_headers")
val extraHeaders: Map<String, String>
Link copied to clipboard
val from: DID? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val pthid: String? = null
Link copied to clipboard
val thid: String? = null
Link copied to clipboard
val to: DID? = null

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

The equals method compares this Message object with another object for equality.

Link copied to clipboard
open override fun hashCode(): Int

Calculates the hash code for the Message object. The hash code is calculated based on the values of the object's id, piuri, from, to, fromPrior, body, extraHeaders, createdTime, expiresTimePlus, attachments, thid, pthid, and ack properties. If any of these properties is null, it is treated as 0 in the calculation.

Link copied to clipboard

Creates a backup message object using the provided properties.

Link copied to clipboard

Converts the current object to a JSON string representation.