Skip to content

Commit bf59455

Browse files
committed
Minimize users feature scope. First attempt.
1 parent 24f21e1 commit bf59455

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

app/src/main/java/com/fernandocejas/android10/sample/app/users/CloudUserDataStore.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
*/
1616
package com.fernandocejas.android10.sample.app.users;
1717

18-
import com.fernandocejas.android10.sample.app.users.cache.UserCache;
1918
import com.fernandocejas.android10.sample.app.data.RestApi;
19+
import com.fernandocejas.android10.sample.app.users.cache.UserCache;
2020
import java.util.List;
2121
import rx.Observable;
2222
import rx.functions.Action1;
2323

2424
/**
2525
* {@link UserDataStore} implementation based on connections to the api (Cloud).
2626
*/
27-
public class CloudUserDataStore implements UserDataStore {
27+
class CloudUserDataStore implements UserDataStore {
2828

2929
private final RestApi restApi;
3030
private final UserCache userCache;
@@ -41,7 +41,7 @@ public class CloudUserDataStore implements UserDataStore {
4141
* @param restApi The {@link RestApi} implementation to use.
4242
* @param userCache A {@link UserCache} to cache data retrieved from the api.
4343
*/
44-
public CloudUserDataStore(RestApi restApi, UserCache userCache) {
44+
CloudUserDataStore(RestApi restApi, UserCache userCache) {
4545
this.restApi = restApi;
4646
this.userCache = userCache;
4747
}

app/src/main/java/com/fernandocejas/android10/sample/app/users/DiskUserDataStore.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/**
2323
* {@link UserDataStore} implementation based on file system data store.
2424
*/
25-
public class DiskUserDataStore implements UserDataStore {
25+
class DiskUserDataStore implements UserDataStore {
2626

2727
private final UserCache userCache;
2828

@@ -31,7 +31,7 @@ public class DiskUserDataStore implements UserDataStore {
3131
*
3232
* @param userCache A {@link UserCache} to cache data retrieved from the api.
3333
*/
34-
public DiskUserDataStore(UserCache userCache) {
34+
DiskUserDataStore(UserCache userCache) {
3535
this.userCache = userCache;
3636
}
3737

app/src/main/java/com/fernandocejas/android10/sample/app/users/User.java

+13-13
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
/**
1919
* Class that represents a User in the domain layer.
2020
*/
21-
public class User {
21+
class User {
2222

2323
private final int userId;
2424

25-
public User(int userId) {
25+
User(int userId) {
2626
this.userId = userId;
2727
}
2828

@@ -32,47 +32,47 @@ public User(int userId) {
3232
private String description;
3333
private int followers;
3434

35-
public int getUserId() {
35+
int getUserId() {
3636
return userId;
3737
}
3838

39-
public String getCoverUrl() {
39+
String getCoverUrl() {
4040
return coverUrl;
4141
}
4242

43-
public void setCoverUrl(String coverUrl) {
43+
void setCoverUrl(String coverUrl) {
4444
this.coverUrl = coverUrl;
4545
}
4646

47-
public String getFullName() {
47+
String getFullName() {
4848
return fullName;
4949
}
5050

51-
public void setFullName(String fullName) {
51+
void setFullName(String fullName) {
5252
this.fullName = fullName;
5353
}
5454

55-
public String getEmail() {
55+
String getEmail() {
5656
return email;
5757
}
5858

59-
public void setEmail(String email) {
59+
void setEmail(String email) {
6060
this.email = email;
6161
}
6262

63-
public String getDescription() {
63+
String getDescription() {
6464
return description;
6565
}
6666

67-
public void setDescription(String description) {
67+
void setDescription(String description) {
6868
this.description = description;
6969
}
7070

71-
public int getFollowers() {
71+
int getFollowers() {
7272
return followers;
7373
}
7474

75-
public void setFollowers(int followers) {
75+
void setFollowers(int followers) {
7676
this.followers = followers;
7777
}
7878

app/src/main/java/com/fernandocejas/android10/sample/app/users/UserDataStore.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,14 +15,13 @@
1515
*/
1616
package com.fernandocejas.android10.sample.app.users;
1717

18-
import com.fernandocejas.android10.sample.app.users.UserEntity;
1918
import java.util.List;
2019
import rx.Observable;
2120

2221
/**
2322
* Interface that represents a data store from where data is retrieved.
2423
*/
25-
public interface UserDataStore {
24+
interface UserDataStore {
2625
/**
2726
* Get an {@link rx.Observable} which will emit a List of {@link UserEntity}.
2827
*/

0 commit comments

Comments
 (0)