18 lines
596 B
Kotlin
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>()
|