package org.octopus.internal.common.mappers

interface GenericMapper<M, E> {

    fun toEntity(model: M): E
    fun toModel(entity: E): M

    fun toEntities(models: MutableList<M>): MutableList<E> =
        models.map { toEntity(it) }.toMutableList()

    fun toModels(entities: MutableList<E>): MutableList<M> =
        entities.map { toModel(it) }.toMutableList()
}