2016-12-03 16:45:13 +01:00
|
|
|
package org.mariotaku.twidere.model;
|
|
|
|
|
|
|
|
import android.accounts.Account;
|
2016-12-04 04:58:03 +01:00
|
|
|
import android.os.Parcel;
|
|
|
|
import android.os.Parcelable;
|
2016-12-03 16:45:13 +01:00
|
|
|
import android.support.annotation.ColorInt;
|
2016-12-04 04:58:03 +01:00
|
|
|
import android.support.annotation.NonNull;
|
|
|
|
|
|
|
|
import com.hannesdorfmann.parcelableplease.annotation.ParcelablePlease;
|
2016-12-03 16:45:13 +01:00
|
|
|
|
|
|
|
import org.mariotaku.twidere.annotation.AccountType;
|
2016-12-04 04:58:03 +01:00
|
|
|
import org.mariotaku.twidere.model.account.AccountExtras;
|
2016-12-03 16:45:13 +01:00
|
|
|
import org.mariotaku.twidere.model.account.cred.Credentials;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by mariotaku on 2016/12/3.
|
|
|
|
*/
|
|
|
|
|
2016-12-04 04:58:03 +01:00
|
|
|
@ParcelablePlease
|
2016-12-05 04:39:22 +01:00
|
|
|
public class AccountDetails implements Parcelable, Comparable<AccountDetails> {
|
2016-12-03 16:45:13 +01:00
|
|
|
|
2016-12-04 04:58:03 +01:00
|
|
|
public boolean dummy;
|
2016-12-03 16:45:13 +01:00
|
|
|
public Account account;
|
|
|
|
public UserKey key;
|
|
|
|
public Credentials credentials;
|
|
|
|
public ParcelableUser user;
|
|
|
|
@ColorInt
|
|
|
|
public int color;
|
|
|
|
public int position;
|
|
|
|
public boolean activated;
|
|
|
|
@AccountType
|
|
|
|
public String type;
|
|
|
|
@Credentials.Type
|
|
|
|
public String credentials_type;
|
2016-12-04 04:58:03 +01:00
|
|
|
public AccountExtras extras;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int describeContents() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeToParcel(Parcel dest, int flags) {
|
|
|
|
AccountDetailsParcelablePlease.writeToParcel(this, dest, flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "AccountDetails{" +
|
|
|
|
"account=" + account +
|
|
|
|
", dummy=" + dummy +
|
|
|
|
", key=" + key +
|
|
|
|
", credentials=" + credentials +
|
|
|
|
", user=" + user +
|
|
|
|
", color=" + color +
|
|
|
|
", position=" + position +
|
|
|
|
", activated=" + activated +
|
|
|
|
", type='" + type + '\'' +
|
|
|
|
", credentials_type='" + credentials_type + '\'' +
|
|
|
|
", extras=" + extras +
|
|
|
|
'}';
|
|
|
|
}
|
|
|
|
|
2016-12-05 04:39:22 +01:00
|
|
|
@Override
|
|
|
|
public int compareTo(@NonNull AccountDetails that) {
|
|
|
|
return this.position - that.position;
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
public static AccountDetails dummy() {
|
|
|
|
AccountDetails dummy = new AccountDetails();
|
|
|
|
dummy.dummy = true;
|
|
|
|
return dummy;
|
|
|
|
}
|
|
|
|
|
2016-12-04 04:58:03 +01:00
|
|
|
public static final Creator<AccountDetails> CREATOR = new Creator<AccountDetails>() {
|
|
|
|
public AccountDetails createFromParcel(Parcel source) {
|
|
|
|
AccountDetails target = new AccountDetails();
|
|
|
|
AccountDetailsParcelablePlease.readFromParcel(target, source);
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
|
|
|
public AccountDetails[] newArray(int size) {
|
|
|
|
return new AccountDetails[size];
|
|
|
|
}
|
|
|
|
};
|
2016-12-03 16:45:13 +01:00
|
|
|
}
|