Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Furkan Akdemir furkanakdemir

🏠
Working from home
View GitHub Profile
@furkanakdemir
furkanakdemir / RemoteMapper.kt
Last active Mar 28, 2020
An interface to bidirectionally map domain and raw
View RemoteMapper.kt
interface Raw
interface Domain
interface RemoteMapper<D : Domain, R : Raw> {
fun mapRaw(raw: R): D
fun mapDomain(domain: D): R
}
@furkanakdemir
furkanakdemir / LocalMapper.kt
Created Mar 28, 2020
An interface to bidirectionally map domain and entity
View LocalMapper.kt
interface Entity
interface Domain
interface LocalMapper<D : Domain, E : Entity> {
fun mapEntity(entity: E): Domain
fun mapDomain(domain: D): Entity
}