mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
Convert few model classes to kotlin (#3270)
This commit is contained in:
parent
d0f97398a5
commit
b0be4970ef
86 changed files with 661 additions and 1300 deletions
|
|
@ -1,25 +0,0 @@
|
|||
package fr.free.nrw.commons.wikidata.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Response class for add edit tag
|
||||
*/
|
||||
public class AddEditTagResponse {
|
||||
|
||||
@SerializedName("tag")
|
||||
@Expose
|
||||
private List<EditTag> tag = null;
|
||||
|
||||
public List<EditTag> getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(List<EditTag> tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package fr.free.nrw.commons.wikidata.model
|
||||
|
||||
import com.google.gson.annotations.Expose
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
/**
|
||||
* Response class for add edit tag
|
||||
*/
|
||||
class AddEditTagResponse {
|
||||
@SerializedName("tag")
|
||||
@Expose
|
||||
var tag: List<EditTag>? = null
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
package fr.free.nrw.commons.wikidata.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Tag class used when adding wikidata edit tag
|
||||
*/
|
||||
public class EditTag {
|
||||
|
||||
@SerializedName("revid")
|
||||
@Expose
|
||||
private Integer revid;
|
||||
@SerializedName("status")
|
||||
@Expose
|
||||
private String status;
|
||||
@SerializedName("actionlogid")
|
||||
@Expose
|
||||
private Integer actionlogid;
|
||||
@SerializedName("added")
|
||||
@Expose
|
||||
private List<String> added;
|
||||
@SerializedName("removed")
|
||||
@Expose
|
||||
private List<Object> removed;
|
||||
|
||||
public EditTag(Integer revid, String status, Integer actionlogid, List<String> added, List<Object> removed) {
|
||||
this.revid = revid;
|
||||
this.status = status;
|
||||
this.actionlogid = actionlogid;
|
||||
this.added = added;
|
||||
this.removed = removed;
|
||||
}
|
||||
|
||||
public Integer getRevid() {
|
||||
return revid;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public Integer getActionlogid() {
|
||||
return actionlogid;
|
||||
}
|
||||
|
||||
public List<String> getAdded() {
|
||||
return added;
|
||||
}
|
||||
|
||||
public List<Object> getRemoved() {
|
||||
return removed;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package fr.free.nrw.commons.wikidata.model
|
||||
|
||||
import com.google.gson.annotations.Expose
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
/**
|
||||
* Tag class used when adding wikidata edit tag
|
||||
*/
|
||||
class EditTag(@field:Expose @field:SerializedName("revid") val revid: Int, @field:Expose @field:SerializedName("status") val status: String, @field:Expose @field:SerializedName("actionlogid") val actionlogid: Int, @field:Expose @field:SerializedName("added") val added: List<String>, @field:Expose @field:SerializedName("removed") val removed: List<Any>)
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package fr.free.nrw.commons.wikidata.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GetWikidataEditCountResponse {
|
||||
@SerializedName("edits")
|
||||
private final int wikidataEditCount;
|
||||
|
||||
public GetWikidataEditCountResponse(int wikidataEditCount) {
|
||||
this.wikidataEditCount = wikidataEditCount;
|
||||
}
|
||||
|
||||
public int getWikidataEditCount() {
|
||||
return wikidataEditCount;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package fr.free.nrw.commons.wikidata.model
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
class GetWikidataEditCountResponse(@field:SerializedName("edits") val wikidataEditCount: Int)
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
package fr.free.nrw.commons.wikidata.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* PageInfo model class with last revision id of the edited Wikidata entity
|
||||
*/
|
||||
public class PageInfo {
|
||||
@SerializedName("lastrevid")
|
||||
@Expose
|
||||
private Long lastrevid;
|
||||
|
||||
public PageInfo(Long lastrevid) {
|
||||
this.lastrevid = lastrevid;
|
||||
}
|
||||
|
||||
public Long getLastrevid() {
|
||||
return lastrevid;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package fr.free.nrw.commons.wikidata.model
|
||||
|
||||
import com.google.gson.annotations.Expose
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
/**
|
||||
* PageInfo model class with last revision id of the edited Wikidata entity
|
||||
*/
|
||||
class PageInfo(@field:Expose @field:SerializedName("lastrevid") val lastrevid: Long)
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package fr.free.nrw.commons.wikidata.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Wikidata create claim response model class
|
||||
*/
|
||||
public class WbCreateClaimResponse {
|
||||
|
||||
@SerializedName("pageinfo")
|
||||
@Expose
|
||||
private PageInfo pageinfo;
|
||||
@SerializedName("success")
|
||||
@Expose
|
||||
private Integer success;
|
||||
|
||||
public WbCreateClaimResponse(PageInfo pageinfo, Integer success) {
|
||||
this.pageinfo = pageinfo;
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public PageInfo getPageinfo() {
|
||||
return pageinfo;
|
||||
}
|
||||
|
||||
public Integer getSuccess() {
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package fr.free.nrw.commons.wikidata.model
|
||||
|
||||
import com.google.gson.annotations.Expose
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
/**
|
||||
* Wikidata create claim response model class
|
||||
*/
|
||||
class WbCreateClaimResponse(@field:Expose @field:SerializedName("pageinfo") val pageinfo: PageInfo, @field:Expose @field:SerializedName("success") val success: Int)
|
||||
Loading…
Add table
Add a link
Reference in a new issue