Convert few model classes to kotlin (#3270)

This commit is contained in:
Vivek Maskara 2019-12-06 22:06:53 +05:30 committed by Josephine Lim
parent d0f97398a5
commit b0be4970ef
86 changed files with 661 additions and 1300 deletions

View file

@ -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;
}
}

View file

@ -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
}

View file

@ -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;
}
}

View file

@ -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>)

View file

@ -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;
}
}

View file

@ -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)

View file

@ -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;
}
}

View file

@ -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)

View file

@ -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;
}
}

View file

@ -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)