Beispiel #1
0
    public void process(Object obj) {
      if (FacebookUser.class.isInstance(obj)) {
        if (perm != null) {
          try {
            // save data into database
            FacebookUser user = (FacebookUser) obj;
            orm.addFacebookUser(user);

            // save relation ship
            uids[0] = user.uid;
            orm.addFriends(perm.getLogerInUserID(), uids);
            user.despose();
            user = null;

          } catch (Exception ne) {
          }
        }
      }
    }
Beispiel #2
0
  public FacebookUser clone() {
    FacebookUser user = new FacebookUser();
    user.uid = this.uid;
    user.birthday = this.birthday;
    user.first_name = this.first_name;
    user.last_name = this.last_name;
    user.name = this.name;
    user.pic_square = this.pic_square;
    user.pic = this.pic;
    user.pic_small = this.pic_small;
    user.sex = this.sex;
    user.event_sync = this.event_sync;
    user.event_last_sync = this.event_last_sync;
    user.ceid = this.ceid;
    user.message = this.message;
    user.statusid = this.statusid;
    user.statustime = this.statustime;
    user.bd_date = this.bd_date;
    user.selected = this.selected;
    user.isfriend = this.isfriend;

    user.about_me = this.about_me;
    user.activities = this.activities;
    user.quotes = this.quotes;
    user.books = this.books;
    user.movies = this.movies;
    user.music = this.music;
    user.tv = this.tv;
    user.online_presence = this.online_presence;
    user.is_app_user = this.is_app_user;
    user.relationship_status = relationship_status;
    user.isShoutcut = this.isShoutcut;

    if (this.current_location != null) {
      user.current_location = new Current_Location();
      user.current_location.city = this.current_location.city;
      user.current_location.country = this.current_location.country;
      user.current_location.state = this.current_location.state;
      user.current_location.zip = this.current_location.zip;
    }

    if (this.education_history != null && this.education_history.size() > 0) {
      user.education_history = new ArrayList<Education_History>();
      for (int i = 0; i < this.education_history.size(); i++) {
        Education_History item = this.education_history.get(i);
        Education_History newitem = new Education_History();
        newitem.degree = item.degree;
        newitem.name = item.name;
        newitem.year = item.year;
        newitem.concentrations = new ArrayList<String>();
        for (int j = 0; i < item.concentrations.size(); j++) {
          newitem.concentrations.add(item.concentrations.get(j));
        }
        user.education_history.add(newitem);
      }
    }

    if (this.hometown_location != null) {
      user.hometown_location = new Current_Location();
      user.hometown_location.city = hometown_location.city;
      user.hometown_location.country = hometown_location.country;
      user.hometown_location.state = hometown_location.state;
      user.hometown_location.zip = hometown_location.zip;
    }

    if (meeting_for != null && meeting_for.size() > 0) {
      user.meeting_for = new ArrayList<String>();
      user.meeting_for.addAll(meeting_for);
    }

    if (meeting_sex != null && meeting_sex.size() > 0) {
      user.meeting_sex = new ArrayList<String>();
      user.meeting_sex.addAll(meeting_sex);
    }

    if (work_history != null && work_history.size() > 0) {
      user.work_history = new ArrayList<Work_History>();
      for (int i = 0; i < work_history.size(); i++) {
        Work_History item = work_history.get(i);
        Work_History object = new Work_History();
        object.city = item.city;
        object.country = item.company_name;
        object.state = item.state;

        object.company_name = item.company_name;
        object.description = item.description;
        object.position = item.position;
        object.start_date = item.start_date;
        object.end_date = item.end_date;
        user.work_history.add(object);
      }
    }
    return user;
  }