All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avito.android.serializers.OwnerSerializers.kt Maven / Gradle / Ivy

There is a newer version: 2024.32
Show newest version
package com.avito.android.serializers

import com.avito.android.model.Owner

public sealed interface OwnerFieldSerializer

/**
 * Serializer that can serializer Owner to plain string by his name.
 *
 * Serialization and deserialization performs by only name of owner.
 */
public interface OwnerNameSerializer : OwnerFieldSerializer {

    public fun deserialize(ownerName: String): Owner

    public fun serialize(owner: Owner): String
}

/**
 * A serializer that can serialize an owner into a regular string by its identifier.
 *
 * The serialization operation may contain a list of identifiers,
 * and the identifiers may be both own and child identifiers,
 * such as unit command identifiers.
 *
 * The deserialization operation must identify the Owner by an unambiguous identifier.
 */
public interface OwnerIdSerializer : OwnerFieldSerializer {

    public fun deserialize(ownerId: String): Owner

    public fun serialize(owner: Owner): List
}

public object OwnerNoOpSerializer : OwnerFieldSerializer




© 2015 - 2024 Weber Informatics LLC | Privacy Policy