Accountpublic class Account extends Object implements android.os.ParcelableValue type that represents an Account in the {@link AccountManager}. This object is
{@link Parcelable} and also overrides {@link #equals} and {@link #hashCode}, making it
suitable for use as the key of a {@link java.util.Map} |
Fields Summary |
---|
public final String | name | public final String | type | public static final Creator | CREATOR |
Constructors Summary |
---|
public Account(String name, String type)
if (TextUtils.isEmpty(name)) {
throw new IllegalArgumentException("the name must not be empty: " + name);
}
if (TextUtils.isEmpty(type)) {
throw new IllegalArgumentException("the type must not be empty: " + type);
}
this.name = name;
this.type = type;
| public Account(android.os.Parcel in)
this.name = in.readString();
this.type = in.readString();
|
Methods Summary |
---|
public int | describeContents()
return 0;
| public boolean | equals(java.lang.Object o)
if (o == this) return true;
if (!(o instanceof Account)) return false;
final Account other = (Account)o;
return name.equals(other.name) && type.equals(other.type);
| public int | hashCode()
int result = 17;
result = 31 * result + name.hashCode();
result = 31 * result + type.hashCode();
return result;
| public java.lang.String | toString()
return "Account {name=" + name + ", type=" + type + "}";
| public void | writeToParcel(android.os.Parcel dest, int flags)
dest.writeString(name);
dest.writeString(type);
|
|