Start work on integrating Retrofit - Update Account entity to be fetched with Retrofit and parsed with GSON
This commit is contained in:
parent
348d2c8b4f
commit
3120fbed4c
12 changed files with 219 additions and 193 deletions
|
@ -0,0 +1,63 @@
|
|||
/* Copyright 2017 Andrew Dawson
|
||||
*
|
||||
* This file is part of Tusky.
|
||||
*
|
||||
* Tusky is free software: you can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with Tusky. If not, see
|
||||
* <http://www.gnu.org/licenses/>. */
|
||||
|
||||
package com.keylesspalace.tusky.entity;
|
||||
|
||||
import android.text.Spanned;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Account {
|
||||
public String id;
|
||||
|
||||
@SerializedName("acct")
|
||||
public String username;
|
||||
|
||||
@SerializedName("display_name")
|
||||
public String displayName;
|
||||
|
||||
public Spanned note;
|
||||
|
||||
public String url;
|
||||
|
||||
public String avatar;
|
||||
|
||||
public String header;
|
||||
|
||||
@SerializedName("followers_count")
|
||||
public String followersCount;
|
||||
|
||||
@SerializedName("following_count")
|
||||
public String followingCount;
|
||||
|
||||
@SerializedName("statuses_count")
|
||||
public String statusesCount;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this.id == null) {
|
||||
return this == other;
|
||||
} else if (!(other instanceof Account)) {
|
||||
return false;
|
||||
}
|
||||
Account account = (Account) other;
|
||||
return account.id.equals(this.id);
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ package com.keylesspalace.tusky.entity;
|
|||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Media {
|
||||
public int id;
|
||||
public String id;
|
||||
|
||||
public String type;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.keylesspalace.tusky.entity;
|
|||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Relationship {
|
||||
public int id;
|
||||
public String id;
|
||||
|
||||
public boolean following;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue