Advertisement
Guest User

Untitled

a guest
May 26th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. public class Account {
  2.  
  3. private final String userId;
  4. private final String token;
  5.  
  6. public Account(String userId, String token) {
  7. this.userId = userId;
  8. this.token = token;
  9. }
  10.  
  11. public String getUserId() {
  12. return userId;
  13. }
  14.  
  15. public String getToken() {
  16. return token;
  17. }
  18.  
  19. public static class Builder {
  20.  
  21. private String userId;
  22. private String token;
  23.  
  24. public Builder setUserId(String userId) {
  25. this.userId = userId;
  26.  
  27. return this;
  28. }
  29.  
  30. public Builder setToken(String token) {
  31. this.token = token;
  32.  
  33. return this;
  34. }
  35.  
  36. public Account build() {
  37. return new Account(userId, token);
  38. }
  39.  
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement