Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7f7c1b4

Browse files
committed
Fix some small things
1 parent c6a2132 commit 7f7c1b4

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

‎data/src/main/java/com/fernandocejas/android10/sample/data/cache/UserCacheImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ public UserCacheImpl(Context context, JsonSerializer userCacheSerializer,
8080

8181
@Override public void put(UserEntity userEntity) {
8282
if (userEntity != null) {
83-
File userEntitiyFile = this.buildFile(userEntity.getUserId());
83+
File userEntityFile = this.buildFile(userEntity.getUserId());
8484
if (!isCached(userEntity.getUserId())) {
8585
String jsonString = this.serializer.serialize(userEntity);
86-
this.executeAsynchronously(new CacheWriter(this.fileManager, userEntitiyFile,
86+
this.executeAsynchronously(new CacheWriter(this.fileManager, userEntityFile,
8787
jsonString));
8888
setLastCacheUpdateTimeMillis();
8989
}

‎data/src/main/java/com/fernandocejas/android10/sample/data/repository/UserDataRepository.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,14 @@ public UserDataRepository(UserDataStoreFactory dataStoreFactory,
4747
this.userEntityDataMapper = userEntityDataMapper;
4848
}
4949

50-
@SuppressWarnings("Convert2MethodRef")
5150
@Override public Observable<List<User>> users() {
5251
//we always get all users from the cloud
5352
final UserDataStore userDataStore = this.userDataStoreFactory.createCloudDataStore();
54-
return userDataStore.userEntityList()
55-
.map(userEntities -> this.userEntityDataMapper.transform(userEntities));
53+
return userDataStore.userEntityList().map(this.userEntityDataMapper::transform);
5654
}
5755

58-
@SuppressWarnings("Convert2MethodRef")
5956
@Override public Observable<User> user(int userId) {
6057
final UserDataStore userDataStore = this.userDataStoreFactory.create(userId);
61-
return userDataStore.userEntityDetails(userId)
62-
.map(userEntity -> this.userEntityDataMapper.transform(userEntity));
58+
return userDataStore.userEntityDetails(userId).map(this.userEntityDataMapper::transform);
6359
}
6460
}

‎data/src/main/java/com/fernandocejas/android10/sample/data/repository/datasource/UserDataStoreFactory.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.fernandocejas.android10.sample.data.repository.datasource;
1717

1818
import android.content.Context;
19+
import android.support.annotation.NonNull;
1920
import com.fernandocejas.android10.sample.data.cache.UserCache;
2021
import com.fernandocejas.android10.sample.data.entity.mapper.UserEntityJsonMapper;
2122
import com.fernandocejas.android10.sample.data.net.RestApi;
@@ -33,10 +34,7 @@ public class UserDataStoreFactory {
3334
private final UserCache userCache;
3435

3536
@Inject
36-
public UserDataStoreFactory(Context context, UserCache userCache) {
37-
if (context == null || userCache == null) {
38-
throw new IllegalArgumentException("Constructor parameters cannot be null!!!");
39-
}
37+
public UserDataStoreFactory(@NonNull Context context, @NonNull UserCache userCache) {
4038
this.context = context.getApplicationContext();
4139
this.userCache = userCache;
4240
}

‎domain/src/main/java/com/fernandocejas/android10/sample/domain/interactor/UseCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ protected UseCase(ThreadExecutor threadExecutor,
5252
/**
5353
* Executes the current use case.
5454
*
55-
* @param UseCaseSubscriber The guy who will be listen to the observable build
55+
* @param useCaseSubscriber The guy who will be listen to the observable build
5656
* with {@link #buildUseCaseObservable()}.
5757
*/
5858
@SuppressWarnings("unchecked")
59-
public void execute(Subscriber UseCaseSubscriber) {
59+
public void execute(Subscriber useCaseSubscriber) {
6060
this.subscription = this.buildUseCaseObservable()
6161
.subscribeOn(Schedulers.from(threadExecutor))
6262
.observeOn(postExecutionThread.getScheduler())
63-
.subscribe(UseCaseSubscriber);
63+
.subscribe(useCaseSubscriber);
6464
}
6565

6666
/**

‎presentation/src/main/java/com/fernandocejas/android10/sample/presentation/view/activity/BaseActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected void addFragment(int containerViewId, Fragment fragment) {
4141
* @return {@link com.fernandocejas.android10.sample.presentation.internal.di.components.ApplicationComponent}
4242
*/
4343
protected ApplicationComponent getApplicationComponent() {
44-
return ((AndroidApplication)getApplication()).getApplicationComponent();
44+
return ((AndroidApplication)getApplication()).getApplicationComponent();
4545
}
4646

4747
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /