2023-01-22 15:22:59 +01:00
|
|
|
package app.fedilab.android.mastodon.client.entities.api;
|
2022-04-27 15:20:42 +02:00
|
|
|
/* Copyright 2021 Thomas Schneider
|
|
|
|
*
|
|
|
|
* This file is a part of Fedilab
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* Fedilab 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 Fedilab; if not,
|
|
|
|
* see <http://www.gnu.org/licenses>. */
|
|
|
|
|
|
|
|
import com.google.gson.annotations.SerializedName;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class Tag implements Serializable {
|
|
|
|
|
|
|
|
@SerializedName("name")
|
|
|
|
public String name;
|
|
|
|
@SerializedName("url")
|
|
|
|
public String url;
|
|
|
|
@SerializedName("history")
|
|
|
|
public List<History> history;
|
2022-11-15 09:00:08 +01:00
|
|
|
@SerializedName("following")
|
|
|
|
public boolean following = false;
|
2022-11-11 11:52:57 +01:00
|
|
|
|
|
|
|
public int getWeight() {
|
|
|
|
int weight = 0;
|
2022-11-17 13:43:18 +01:00
|
|
|
if (history != null && history.size() > 0) {
|
|
|
|
for (History h : history) {
|
|
|
|
try {
|
|
|
|
weight += Integer.parseInt(h.accounts);
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
}
|
2022-11-11 11:52:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return weight;
|
|
|
|
}
|
2022-04-27 15:20:42 +02:00
|
|
|
}
|