Created
September 23, 2015 07:48
-
-
Save orhanobut/224f36f6bfd275efe3ed to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Account { | |
| private final User user; | |
| private final String id; | |
| public Account(AccountResponse response) { | |
| id = response.id; | |
| user = User.newUser(response.userResponse); | |
| } | |
| } | |
| public class User { | |
| private final String id; | |
| private final String name; | |
| public static User newUser(UserResponse response) { | |
| if (response == null) { | |
| return null; | |
| } | |
| return new User(response); | |
| } | |
| public User(UserResponse response) { | |
| id = response.id; | |
| name = response.name; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment