Skip to content

Commit 2d8c80c

Browse files
committed
Merge branch 'master' of github.com:bufferapp/clean-architecture-components-boilerplate
2 parents bec1011 + 5ebce78 commit 2d8c80c

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212
classpath "com.dicedmelon.gradle:jacoco-android:0.1.1"
1313

1414

15-
// NOTE: Do not place yrofour application dependencies here; they belong
15+
// NOTE: Do not place your application dependencies here; they belong
1616
// in the individual module build.gradle files
1717
}
1818
}

cache/src/main/java/org/buffer/android/boilerplate/cache/BufferooCacheImpl.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ import javax.inject.Inject
1717
*/
1818
class BufferooCacheImpl @Inject constructor(val bufferoosDatabase: BufferoosDatabase,
1919
private val entityMapper: BufferooEntityMapper,
20-
private val preferencesHelper: PreferencesHelper):
20+
private val preferencesHelper: PreferencesHelper) :
2121
BufferooCache {
2222

2323
private val EXPIRATION_TIME = (60 * 10 * 1000).toLong()
2424

2525
/**
26-
* Retrieve an instance from the database, used for tests
26+
* Retrieve an instance from the database, used for tests.
2727
*/
2828
internal fun getDatabase(): BufferoosDatabase {
2929
return bufferoosDatabase
@@ -64,7 +64,7 @@ class BufferooCacheImpl @Inject constructor(val bufferoosDatabase: BufferoosData
6464
}
6565

6666
/**
67-
* Checked whether there are instances of [CachedBufferoo] stored in the cache
67+
* Check whether there are instances of [CachedBufferoo] stored in the cache.
6868
*/
6969
override fun isCached(): Single<Boolean> {
7070
return Single.defer {
@@ -73,14 +73,14 @@ class BufferooCacheImpl @Inject constructor(val bufferoosDatabase: BufferoosData
7373
}
7474

7575
/**
76-
* Set a point in time at when the cache was last updated
76+
* Set a point in time at when the cache was last updated.
7777
*/
7878
override fun setLastCacheTime(lastCache: Long) {
7979
preferencesHelper.lastCacheTime = lastCache
8080
}
8181

8282
/**
83-
* Check whether the current cached data exceeds the defined [EXPIRATION_TIME] time
83+
* Check whether the current cached data exceeds the defined [EXPIRATION_TIME] time.
8484
*/
8585
override fun isExpired(): Boolean {
8686
val currentTime = System.currentTimeMillis()

data/src/main/java/org/buffer/android/boilerplate/data/repository/BufferooCache.kt

+12-16
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,38 @@ import org.buffer.android.boilerplate.data.model.BufferooEntity
1212
interface BufferooCache {
1313

1414
/**
15-
* Clear all Bufferoos from the cache
15+
* Clear all Bufferoos from the cache.
1616
*/
1717
fun clearBufferoos(): Completable
1818

1919
/**
20-
* Save a given list of Bufferoos to the cache
20+
* Save a given list of Bufferoos to the cache.
2121
*/
2222
fun saveBufferoos(bufferoos: List<BufferooEntity>): Completable
2323

2424
/**
25-
* Retrieve a list of Bufferoos, from the cache
25+
* Retrieve a list of Bufferoos, from the cache.
2626
*/
2727
fun getBufferoos(): Flowable<List<BufferooEntity>>
2828

2929
/**
30-
* Checks if an element (User) exists in the cache.
31-
32-
* @param userId The id used to look for inside the cache.
33-
* *
34-
* @return true if the element is cached, otherwise false.
30+
* Check whether there is a list of Bufferoos stored in the cache.
31+
*
32+
* @return true if the list is cached, otherwise false
3533
*/
3634
fun isCached(): Single<Boolean>
3735

3836
/**
39-
* Checks if an element (User) exists in the cache.
40-
41-
* @param userId The id used to look for inside the cache.
42-
* *
43-
* @return true if the element is cached, otherwise false.
37+
* Set a point in time at when the cache was last updated.
38+
*
39+
* @param lastCache the point in time at when the cache was last updated
4440
*/
4541
fun setLastCacheTime(lastCache: Long)
4642

4743
/**
48-
* Checks if the cache is expired.
49-
50-
* @return true, the cache is expired, otherwise false.
44+
* Check if the cache is expired.
45+
*
46+
* @return true if the cache is expired, otherwise false
5147
*/
5248
fun isExpired(): Boolean
5349

0 commit comments

Comments
 (0)