-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(RecommendationDataSource): RecommendationDataSource abstraction
- Loading branch information
Showing
4 changed files
with
24 additions
and
19 deletions.
There are no files selected for viewing
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
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
11 changes: 3 additions & 8 deletions
11
...tlin/com/personalization/sdk/data/repositories/recommendation/RecommendationDataSource.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,15 +1,10 @@ | ||
package com.personalization.sdk.data.repositories.recommendation | ||
|
||
import com.personalization.sdk.domain.models.RecommendedBy | ||
import javax.inject.Inject | ||
|
||
class RecommendationDataSource @Inject constructor() { | ||
interface RecommendationDataSource { | ||
|
||
private var recommendedBy: RecommendedBy? = null | ||
fun getRecommendedBy(): RecommendedBy? | ||
|
||
fun getRecommendedBy(): RecommendedBy? = recommendedBy | ||
|
||
fun setRecommendedBy(recommendedBy: RecommendedBy?) { | ||
this.recommendedBy = recommendedBy | ||
} | ||
fun setRecommendedBy(recommendedBy: RecommendedBy?) | ||
} |
15 changes: 15 additions & 0 deletions
15
.../com/personalization/sdk/data/repositories/recommendation/RecommendationDataSourceImpl.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.personalization.sdk.data.repositories.recommendation | ||
|
||
import com.personalization.sdk.domain.models.RecommendedBy | ||
import javax.inject.Inject | ||
|
||
class RecommendationDataSourceImpl @Inject constructor() : RecommendationDataSource { | ||
|
||
private var recommendedBy: RecommendedBy? = null | ||
|
||
override fun getRecommendedBy(): RecommendedBy? = recommendedBy | ||
|
||
override fun setRecommendedBy(recommendedBy: RecommendedBy?) { | ||
this.recommendedBy = recommendedBy | ||
} | ||
} |