Android Open Source - stack-overlook User






From Project

Back to project page stack-overlook.

License

The source code is released under:

MIT License

If you think the Android project stack-overlook listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.sambuo.stackoverlook.entities;
//ww w.  ja  v  a2  s .c  om
import org.json.JSONObject;

import com.sambuo.stackoverlook.utilities.Utils;

public class User {
  private long userId;
  private String displayName;
  private String profileImage;
  private String aboutMe;
  
  public long getUserId() {
    return this.userId;
  }

  public void setUserId(long userId) {
    this.userId = userId;
  }
  
  public String getDisplayName() {
    return this.displayName;
  }

  public void setDisplayName(String displayName) {
    this.displayName = displayName;
  }

  public String getProfileImage() {
    return this.profileImage;
  }

  public void setProfileImage(String profileImage) {
    this.profileImage = profileImage;
  }

  public String getAboutMe() {
    return this.aboutMe;
  }

  public void setAboutMe(String aboutMe) {
    this.aboutMe = aboutMe;
  }
  
  public static User fromJSONObject(JSONObject userJson) {
    long userId = Utils.getJsonLongSafe(userJson, "user_id", 0);
    String displayName = Utils.getJsonStringSafe(userJson, "display_name");
    String profileImage = Utils.getJsonStringSafe(userJson, "profile_image");
    String aboutMe = Utils.getJsonStringSafe(userJson, "about_me");
    
    User u = new User();
    u.setUserId(userId);
    u.setDisplayName(displayName);
    u.setAboutMe(aboutMe);
    u.setProfileImage(profileImage);
    return u;
  }
}




Java Source Code List

com.sambuo.stackoverlook.AnswersActivity.java
com.sambuo.stackoverlook.QuestionActivity.java
com.sambuo.stackoverlook.UsersActivity.java
com.sambuo.stackoverlook.entities.Answer.java
com.sambuo.stackoverlook.entities.Question.java
com.sambuo.stackoverlook.entities.User.java
com.sambuo.stackoverlook.repositories.StackOverflowRepository.java
com.sambuo.stackoverlook.utilities.Reducer.java
com.sambuo.stackoverlook.utilities.Utils.java