mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
Use maps for JSON output.
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
package org.briarproject.bramble.identity
|
||||
|
||||
import org.briarproject.bramble.api.identity.Author
|
||||
import javax.annotation.concurrent.Immutable
|
||||
|
||||
@Immutable
|
||||
data class OutputAuthor(
|
||||
val id: ByteArray,
|
||||
val name: String,
|
||||
val publicKey: ByteArray
|
||||
) {
|
||||
constructor(author: Author) : this(
|
||||
id = author.id.bytes,
|
||||
name = author.name,
|
||||
publicKey = author.publicKey
|
||||
)
|
||||
}
|
||||
|
||||
fun Author.output() = OutputAuthor(this)
|
||||
fun Author.output() = mapOf(
|
||||
"formatVersion" to formatVersion,
|
||||
"id" to id.bytes,
|
||||
"name" to name,
|
||||
"publicKey" to publicKey
|
||||
)
|
||||
|
||||
fun Author.Status.output() = name.toLowerCase()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user