Add @JvmField on models fields

source/neox^2
Koitharu 3 years ago
parent f43c482539
commit 7414cf4a4e
No known key found for this signature in database
GPG Key ID: 8E861F8CE6E7CE27

@ -1,14 +1,14 @@
package org.koitharu.kotatsu.parsers.config package org.koitharu.kotatsu.parsers.config
sealed class ConfigKey<T>( sealed class ConfigKey<T>(
val key: String, @JvmField val key: String,
) { ) {
abstract val defaultValue: T abstract val defaultValue: T
class Domain( class Domain(
override val defaultValue: String, override val defaultValue: String,
val presetValues: Array<String>?, @JvmField val presetValues: Array<String>?,
) : ConfigKey<String>("domain") ) : ConfigKey<String>("domain")
class ShowSuspiciousContent( class ShowSuspiciousContent(

@ -3,11 +3,12 @@ package org.koitharu.kotatsu.parsers.model
import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl
class Favicon internal constructor( class Favicon internal constructor(
val url: String, @JvmField val url: String,
val size: Int, @JvmField val size: Int,
internal val rel: String?, @JvmField internal val rel: String?,
) : Comparable<Favicon> { ) : Comparable<Favicon> {
@JvmField
val type: String = url.toHttpUrl().pathSegments.last() val type: String = url.toHttpUrl().pathSegments.last()
.substringAfterLast('.', "").lowercase() .substringAfterLast('.', "").lowercase()

@ -2,7 +2,7 @@ package org.koitharu.kotatsu.parsers.model
class Favicons internal constructor( class Favicons internal constructor(
favicons: Collection<Favicon>, favicons: Collection<Favicon>,
val referer: String, @JvmField val referer: String,
) : Collection<Favicon> { ) : Collection<Favicon> {
private val icons = favicons.sortedDescending() private val icons = favicons.sortedDescending()

@ -6,67 +6,67 @@ class Manga(
/** /**
* Unique identifier for manga * Unique identifier for manga
*/ */
val id: Long, @JvmField val id: Long,
/** /**
* Manga title, human-readable * Manga title, human-readable
*/ */
val title: String, @JvmField val title: String,
/** /**
* Alternative title (for example on other language), may be null * Alternative title (for example on other language), may be null
*/ */
val altTitle: String?, @JvmField val altTitle: String?,
/** /**
* Relative url to manga (**without** a domain) or any other uri. * Relative url to manga (**without** a domain) or any other uri.
* Used principally in parsers * Used principally in parsers
*/ */
val url: String, @JvmField val url: String,
/** /**
* Absolute url to manga, must be ready to open in browser * Absolute url to manga, must be ready to open in browser
*/ */
val publicUrl: String, @JvmField val publicUrl: String,
/** /**
* Normalized manga rating, must be in range of 0..1 or [RATING_UNKNOWN] if rating s unknown * Normalized manga rating, must be in range of 0..1 or [RATING_UNKNOWN] if rating s unknown
* @see hasRating * @see hasRating
*/ */
val rating: Float, @JvmField val rating: Float,
/** /**
* Indicates that manga may contain sensitive information (18+, NSFW) * Indicates that manga may contain sensitive information (18+, NSFW)
*/ */
val isNsfw: Boolean, @JvmField val isNsfw: Boolean,
/** /**
* Absolute link to the cover * Absolute link to the cover
* @see largeCoverUrl * @see largeCoverUrl
*/ */
val coverUrl: String, @JvmField val coverUrl: String,
/** /**
* Tags (genres) of the manga * Tags (genres) of the manga
*/ */
val tags: Set<MangaTag>, @JvmField val tags: Set<MangaTag>,
/** /**
* Manga status (ongoing, finished) or null if unknown * Manga status (ongoing, finished) or null if unknown
*/ */
val state: MangaState?, @JvmField val state: MangaState?,
/** /**
* Author of the manga, may be null * Author of the manga, may be null
*/ */
val author: String?, @JvmField val author: String?,
/** /**
* Large cover url (absolute), null if is no large cover * Large cover url (absolute), null if is no large cover
* @see coverUrl * @see coverUrl
*/ */
val largeCoverUrl: String? = null, @JvmField val largeCoverUrl: String? = null,
/** /**
* Manga description, may be html or null * Manga description, may be html or null
*/ */
val description: String? = null, @JvmField val description: String? = null,
/** /**
* List of chapters * List of chapters
*/ */
val chapters: List<MangaChapter>? = null, @JvmField val chapters: List<MangaChapter>? = null,
/** /**
* Manga source * Manga source
*/ */
val source: MangaSource, @JvmField val source: MangaSource,
) { ) {
/** /**

@ -4,34 +4,34 @@ class MangaChapter(
/** /**
* An unique id of chapter * An unique id of chapter
*/ */
val id: Long, @JvmField val id: Long,
/** /**
* User-readable name of chapter * User-readable name of chapter
*/ */
val name: String, @JvmField val name: String,
/** /**
* Chapter number starting from 1 * Chapter number starting from 1
*/ */
val number: Int, @JvmField val number: Int,
/** /**
* Relative url to chapter (**without** a domain) or any other uri. * Relative url to chapter (**without** a domain) or any other uri.
* Used principally in parsers * Used principally in parsers
*/ */
val url: String, @JvmField val url: String,
/** /**
* User-readable name of scanlator (releaser) or null if unknown * User-readable name of scanlator (releaser) or null if unknown
*/ */
val scanlator: String?, @JvmField val scanlator: String?,
/** /**
* Chapter upload date in milliseconds * Chapter upload date in milliseconds
*/ */
val uploadDate: Long, @JvmField val uploadDate: Long,
/** /**
* User-readable name of branch. * User-readable name of branch.
* A branch is a group of chapters that overlap (e.g. different languages) * A branch is a group of chapters that overlap (e.g. different languages)
*/ */
val branch: String?, @JvmField val branch: String?,
val source: MangaSource, @JvmField val source: MangaSource,
) : Comparable<MangaChapter> { ) : Comparable<MangaChapter> {
override fun compareTo(other: MangaChapter): Int { override fun compareTo(other: MangaChapter): Int {

@ -6,19 +6,19 @@ class MangaPage(
/** /**
* Unique identifier for manga * Unique identifier for manga
*/ */
val id: Long, @JvmField val id: Long,
/** /**
* Relative url to page (**without** a domain) or any other uri. * Relative url to page (**without** a domain) or any other uri.
* Used principally in parsers. * Used principally in parsers.
* May contain link to image or html page. * May contain link to image or html page.
* @see MangaParser.getPageUrl * @see MangaParser.getPageUrl
*/ */
val url: String, @JvmField val url: String,
/** /**
* Absolute url of the small page image if exists, null otherwise * Absolute url of the small page image if exists, null otherwise
*/ */
val preview: String?, @JvmField val preview: String?,
val source: MangaSource, @JvmField val source: MangaSource,
) { ) {
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {

@ -6,13 +6,13 @@ class MangaTag(
/** /**
* User-readable tag title, should be in Title case * User-readable tag title, should be in Title case
*/ */
val title: String, @JvmField val title: String,
/** /**
* Identifier of a tag, must be unique among the source. * Identifier of a tag, must be unique among the source.
* @see MangaParser.getList * @see MangaParser.getList
*/ */
val key: String, @JvmField val key: String,
val source: MangaSource, @JvmField val source: MangaSource,
) { ) {
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {

Loading…
Cancel
Save