forked from commons-app/apps-android-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert wikidata/mwapi to kotlin (part 3) (commons-app#6004)
* Convert Edit to kotlin along with deleting unused class * Converted ExtMetadata to kotlin * Convert ImageInfo to kotlin * Removed unused class * Convert Notification to kotlin * Convert PageProperties to kotlin * Convert PageTitle to kotlin * Convert Namespace to kotlin
- Loading branch information
Showing
22 changed files
with
832 additions
and
1,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
app/src/main/java/fr/free/nrw/commons/wikidata/model/edit/Edit.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
app/src/main/java/fr/free/nrw/commons/wikidata/model/edit/Edit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package fr.free.nrw.commons.wikidata.model.edit | ||
|
||
import fr.free.nrw.commons.wikidata.mwapi.MwPostResponse | ||
|
||
class Edit : MwPostResponse() { | ||
private val edit: Result? = null | ||
|
||
fun edit(): Result? = edit | ||
|
||
class Result { | ||
private val result: String? = null | ||
private val code: String? = null | ||
private val info: String? = null | ||
private val warning: String? = null | ||
|
||
fun editSucceeded(): Boolean = | ||
"Success" == result | ||
|
||
fun code(): String? = code | ||
|
||
fun info(): String? = info | ||
|
||
fun warning(): String? = warning | ||
} | ||
} |
31 changes: 0 additions & 31 deletions
31
app/src/main/java/fr/free/nrw/commons/wikidata/model/edit/EditResult.java
This file was deleted.
Oops, something went wrong.
102 changes: 0 additions & 102 deletions
102
app/src/main/java/fr/free/nrw/commons/wikidata/model/gallery/ExtMetadata.java
This file was deleted.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
app/src/main/java/fr/free/nrw/commons/wikidata/model/gallery/ExtMetadata.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package fr.free.nrw.commons.wikidata.model.gallery | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import org.apache.commons.lang3.StringUtils | ||
|
||
class ExtMetadata { | ||
@SerializedName("DateTime") private val dateTime: Values? = null | ||
@SerializedName("ObjectName") private val objectName: Values? = null | ||
@SerializedName("CommonsMetadataExtension") private val commonsMetadataExtension: Values? = null | ||
@SerializedName("Categories") private val categories: Values? = null | ||
@SerializedName("Assessments") private val assessments: Values? = null | ||
@SerializedName("GPSLatitude") private val gpsLatitude: Values? = null | ||
@SerializedName("GPSLongitude") private val gpsLongitude: Values? = null | ||
@SerializedName("ImageDescription") private val imageDescription: Values? = null | ||
@SerializedName("DateTimeOriginal") private val dateTimeOriginal: Values? = null | ||
@SerializedName("Artist") private val artist: Values? = null | ||
@SerializedName("Credit") private val credit: Values? = null | ||
@SerializedName("Permission") private val permission: Values? = null | ||
@SerializedName("AuthorCount") private val authorCount: Values? = null | ||
@SerializedName("LicenseShortName") private val licenseShortName: Values? = null | ||
@SerializedName("UsageTerms") private val usageTerms: Values? = null | ||
@SerializedName("LicenseUrl") private val licenseUrl: Values? = null | ||
@SerializedName("AttributionRequired") private val attributionRequired: Values? = null | ||
@SerializedName("Copyrighted") private val copyrighted: Values? = null | ||
@SerializedName("Restrictions") private val restrictions: Values? = null | ||
@SerializedName("License") private val license: Values? = null | ||
|
||
fun licenseShortName(): String = licenseShortName?.value ?: "" | ||
|
||
fun licenseUrl(): String = licenseUrl?.value ?: "" | ||
|
||
fun license(): String = license?.value ?: "" | ||
|
||
fun imageDescription(): String = imageDescription?.value ?: "" | ||
|
||
fun imageDescriptionSource(): String = imageDescription?.source ?: "" | ||
|
||
fun objectName(): String = objectName?.value ?: "" | ||
|
||
fun usageTerms(): String = usageTerms?.value ?: "" | ||
|
||
fun dateTimeOriginal(): String = dateTimeOriginal?.value ?: "" | ||
|
||
fun dateTime(): String = dateTime?.value ?: "" | ||
|
||
fun artist(): String = artist?.value ?: "" | ||
|
||
fun categories(): String = categories?.value ?: "" | ||
|
||
fun gpsLatitude(): String = gpsLatitude?.value ?: "" | ||
|
||
fun gpsLongitude(): String = gpsLongitude?.value ?: "" | ||
|
||
fun credit(): String = credit?.value ?: "" | ||
|
||
class Values { | ||
val value: String? = null | ||
val source: String? = null | ||
val hidden: String? = null | ||
} | ||
} |
Oops, something went wrong.