-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ed5642
commit 1565adb
Showing
3 changed files
with
0 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
app/src/main/java/com/karumi/jetpack/superheroes/domain/usecase/GetSuperHeroById.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package com.karumi.jetpack.superheroes.domain.usecase | ||
|
||
import androidx.annotation.WorkerThread | ||
import com.karumi.jetpack.superheroes.data.repository.SuperHeroRepository | ||
import com.karumi.jetpack.superheroes.domain.model.SuperHero | ||
|
||
class GetSuperHeroById(private val superHeroesRepository: SuperHeroRepository) { | ||
@WorkerThread | ||
operator fun invoke(id: String): SuperHero? = superHeroesRepository.get(id) | ||
} |
2 changes: 0 additions & 2 deletions
2
app/src/main/java/com/karumi/jetpack/superheroes/domain/usecase/GetSuperHeroes.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package com.karumi.jetpack.superheroes.domain.usecase | ||
|
||
import androidx.annotation.WorkerThread | ||
import com.karumi.jetpack.superheroes.data.repository.SuperHeroRepository | ||
import com.karumi.jetpack.superheroes.domain.model.SuperHero | ||
|
||
class GetSuperHeroes(private val superHeroesRepository: SuperHeroRepository) { | ||
@WorkerThread | ||
operator fun invoke(): List<SuperHero> = superHeroesRepository.getAllSuperHeroes() | ||
} |
2 changes: 0 additions & 2 deletions
2
app/src/main/java/com/karumi/jetpack/superheroes/domain/usecase/SaveSuperHero.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package com.karumi.jetpack.superheroes.domain.usecase | ||
|
||
import androidx.annotation.WorkerThread | ||
import com.karumi.jetpack.superheroes.data.repository.SuperHeroRepository | ||
import com.karumi.jetpack.superheroes.domain.model.SuperHero | ||
|
||
class SaveSuperHero(private val superHeroesRepository: SuperHeroRepository) { | ||
@WorkerThread | ||
operator fun invoke(superHero: SuperHero): SuperHero? = | ||
superHeroesRepository.save(superHero) | ||
} |