Files
SimpleNotes/persistance/src/main/kotlin/converters/UserConverter.kt
T
2020-10-21 22:55:36 +02:00

18 lines
596 B
Kotlin

package be.simplenotes.persistance.converters
import be.simplenotes.domain.model.PersistedUser
import be.simplenotes.domain.model.User
import be.simplenotes.persistance.users.UserEntity
import me.liuwj.ktorm.entity.Entity
import org.mapstruct.Mapper
@Mapper(uses = [UserEntityFactory::class])
internal interface UserConverter {
fun toUser(userEntity: UserEntity): User
fun toPersistedUser(userEntity: UserEntity): PersistedUser
fun toEntity(user: User): UserEntity
fun toEntity(user: PersistedUser): UserEntity
}
internal class UserEntityFactory : Entity.Factory<UserEntity>()