Android Open Source - Test-SimpleTwitterClient Person






From Project

Back to project page Test-SimpleTwitterClient.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project Test-SimpleTwitterClient 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.example.Twitter_Android.Logic;
//  ww  w.j  a  v a  2  s . com
import android.os.Parcel;
import android.os.Parcelable;

public class Person implements Comparable<Person>, Parcelable {
  private final String name;
  private final String screenName;
  private final String profileImage;
  private final String location;
  private final String description;
  private boolean isFriend;
  private final long ID;

  public static final Parcelable.Creator<Person> CREATOR = new Parcelable.Creator<Person>() {
    @Override
    public Person createFromParcel(Parcel source) {
      return new Person(source);
    }

    public Person[] newArray(int size) {
      return new Person[size];
    }
  };

  private Person(Parcel source) {
    name = source.readString();
    screenName = source.readString();
    profileImage = source.readString();
    location = source.readString();
    description = source.readString();
    boolean[] array = new boolean[1];
    source.readBooleanArray(array);
    isFriend = array[0];
    ID = source.readLong();
  }

  //------------------------------------------------------------------------------------------------------------------
  public Person(String name, String screenName, String profileImage, String location, String description, boolean isFriend, long ID) {
    this.name = name;
    this.screenName = screenName;
    this.profileImage = profileImage;
    this.location = location;
    this.description = description;
    this.isFriend = isFriend;
    this.ID = ID;
  }
  //------------------------------------------------------------------------------------------------------------------

  public String getName() {
    return name;
  }
  //------------------------------------------------------------------------------------------------------------------

  public String getScreenName() {
    return screenName;
  }
  //------------------------------------------------------------------------------------------------------------------

  public String getProfileImage() {
    return profileImage;
  }
  //------------------------------------------------------------------------------------------------------------------

  public String getLocation() {
    return location;
  }
  //------------------------------------------------------------------------------------------------------------------

  public String getDescription() {
    return description;
  }

  //------------------------------------------------------------------------------------------------------------------

  public long getID() {
    return ID;
  }

  //------------------------------------------------------------------------------------------------------------------
  public boolean isFriend() {
    return isFriend;
  }

  //------------------------------------------------------------------------------------------------------------------
  @Override
  public String toString() {
    return "Name: " + name + "\nFrom: " + location + "\nDescription: " + description;
  }
  //------------------------------------------------------------------------------------------------------------------

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || Person.class != o.getClass()) return false;

    Person person = (Person) o;

    return ID == person.ID
        && description.equals(person.description)
        && location.equals(person.location)
        && name.equals(person.name)
        && profileImage.equals(person.profileImage)
        && screenName.equals(person.screenName);
  }
  //------------------------------------------------------------------------------------------------------------------

  @Override
  public int hashCode() {
    return name.hashCode()
        + profileImage.hashCode()
        + location.hashCode()
        + description.hashCode()
        + screenName.hashCode()
        + Boolean.valueOf(isFriend).hashCode()
        + Long.valueOf(ID).hashCode();
  }

  @Override
  public int compareTo(Person another) {
    return name.compareToIgnoreCase(another.getName());
  }

  public void changeFriendshipRelations() {
    isFriend = !isFriend;
  }

  @Override
  public int describeContents() {
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(name);
    dest.writeString(screenName);
    dest.writeString(profileImage);
    dest.writeString(location);
    dest.writeString(description);
    dest.writeBooleanArray(new boolean[]{isFriend});
    dest.writeLong(ID);
  }
}




Java Source Code List

com.example.Twitter_Android.AppActivity.ConcreteUserTimelineActivity.java
com.example.Twitter_Android.AppActivity.MainActivity.java
com.example.Twitter_Android.AppActivity.MessagesActivity.java
com.example.Twitter_Android.AppActivity.SearchableActivity.java
com.example.Twitter_Android.AppActivity.SettingsActivity.java
com.example.Twitter_Android.AsynkTasks.ImageDownloader.java
com.example.Twitter_Android.AsynkTasks.TaskDeleteTweet.java
com.example.Twitter_Android.AsynkTasks.TaskFollow.java
com.example.Twitter_Android.AsynkTasks.TaskPostTweet.java
com.example.Twitter_Android.AsynkTasks.TaskReply.java
com.example.Twitter_Android.AsynkTasks.TaskRetweet.java
com.example.Twitter_Android.AsynkTasks.TaskSendMessage.java
com.example.Twitter_Android.AsynkTasks.TaskUnfollow.java
com.example.Twitter_Android.Fragments.ConcreteUserTimelineFragment.java
com.example.Twitter_Android.Fragments.ConnectedUserTimelineFragment.java
com.example.Twitter_Android.Fragments.FollowersFragment.java
com.example.Twitter_Android.Fragments.FollowingsFragment.java
com.example.Twitter_Android.Fragments.HomeTimelineFragment.java
com.example.Twitter_Android.Fragments.TimelineFragment.java
com.example.Twitter_Android.Fragments.UserInfoFragment.java
com.example.Twitter_Android.Fragments.Adapters.ConcreteUserTimelineAdapter.java
com.example.Twitter_Android.Fragments.Adapters.FollowingsListAdapter.java
com.example.Twitter_Android.Fragments.Adapters.MessagesAdapter.java
com.example.Twitter_Android.Fragments.Adapters.TimelineAdapter.java
com.example.Twitter_Android.Fragments.Adapters.TweetAdapter.java
com.example.Twitter_Android.Fragments.Dialogs.DeleteTweetDialog.java
com.example.Twitter_Android.Fragments.Dialogs.DirectMessageDialog.java
com.example.Twitter_Android.Fragments.Dialogs.ErrorDialog.java
com.example.Twitter_Android.Fragments.Dialogs.PostTweetDialog.java
com.example.Twitter_Android.Fragments.Dialogs.ReplyDialog.java
com.example.Twitter_Android.Fragments.Dialogs.RetweetDialog.java
com.example.Twitter_Android.Fragments.Dialogs.ShowImageDialog.java
com.example.Twitter_Android.Fragments.Dialogs.UserInfoDialog.java
com.example.Twitter_Android.Fragments.Preferences.SettingsFragment.java
com.example.Twitter_Android.Loaders.AsyncUserInfoLoader.java
com.example.Twitter_Android.Loaders.FollowersLoader.java
com.example.Twitter_Android.Loaders.FollowingsLoader.java
com.example.Twitter_Android.Loaders.HomeTimelineLoader.java
com.example.Twitter_Android.Loaders.MessageLoader.java
com.example.Twitter_Android.Loaders.Task_LoadSearchedTweets.java
com.example.Twitter_Android.Loaders.Task_LoadSearchedUsers.java
com.example.Twitter_Android.Loaders.TweetLoader.java
com.example.Twitter_Android.Loaders.UserTimelineLoader.java
com.example.Twitter_Android.Logic.AppDatabase.java
com.example.Twitter_Android.Logic.Constants.java
com.example.Twitter_Android.Logic.DataCache.java
com.example.Twitter_Android.Logic.FileWorker.java
com.example.Twitter_Android.Logic.Person.java
com.example.Twitter_Android.Logic.Tweet.java
com.example.Twitter_Android.Net.Connector.java
com.example.Twitter_Android.Net.Parser.java
com.mass.cmassive.CMassive.java