EntityMapper
EntityMapper used for creating cache or remote mapper.
Example:
data class Student(val name: String)
data class StudentResponse(val id: Int, val name: String)
class StudentMapper : EntityMapper<StudentResponse, Student> {
override fun mapFromEntity(entity: StudentResponse): Student {
return Student(entity.name)
}
override fun mapToEntity(domainModel: Student): StudentResponse {
return StudentResponse(-1, domainModel.name)
}
}
Content copied to clipboard
Since
1.3.0