Created
January 8, 2021 15:27
-
-
Save ngallazzi/7a886617410fe7bb9fdf95d22bfc3442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BookEntityMapper { | |
fun toBookEntity(volume: Volume): BookEntity { | |
return BookEntity( | |
id = volume.id, | |
title = volume.volumeInfo.title, | |
authors = volume.volumeInfo.authors, | |
imageUrl = volume.volumeInfo.imageUrl | |
) | |
} | |
fun toVolume(bookEntity: BookEntity): Volume { | |
return Volume( | |
bookEntity.id, | |
VolumeInfo(bookEntity.title, bookEntity.authors, bookEntity.imageUrl) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment