Last active
December 2, 2018 17:19
-
-
Save ThanawatMas/75f189a7d94f548c12f1a1138405101a to your computer and use it in GitHub Desktop.
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
public class UserProfile implements Api { | |
private String id; | |
private String name; | |
private int level; | |
private long userExp; | |
private long expToNextLevel; | |
private String currentCategory; | |
public static Observable<Api> mockApi() { | |
return Observable.just(getUserFromSession("mocking")); | |
} | |
private static final UserProfile getUserFromSession(String session) { | |
//MockData for demonstration instead of query from database | |
UserProfile userProfile = new UserProfile(); | |
userProfile.setId("37403243922343"); | |
userProfile.setName("MockUser"); | |
userProfile.setLevel(54); | |
userProfile.setUserExp(200L); | |
userProfile.setExpToNextLevel(1000L); | |
userProfile.setCurrentCategory("Shoe"); | |
return userProfile; | |
} | |
@Override | |
public String getApiName() { | |
return getClass().getSimpleName(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment