Improved KDoc

This commit is contained in:
Erik C. Thauvin 2022-10-05 23:03:07 -07:00
parent bfcbafc05a
commit 77b62fc6dc
13 changed files with 23 additions and 32 deletions

3
.idea/compiler.xml generated
View file

@ -2,6 +2,9 @@
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<bytecodeTargetLevel target="11"> <bytecodeTargetLevel target="11">
<module name="examples" target="18" />
<module name="examples.main" target="18" />
<module name="examples.test" target="18" />
<module name="jokeapi-examples.app" target="18" /> <module name="jokeapi-examples.app" target="18" />
<module name="jokeapi-examples.app.main" target="18" /> <module name="jokeapi-examples.app.main" target="18" />
<module name="jokeapi-examples.app.test" target="18" /> <module name="jokeapi-examples.app.test" target="18" />

View file

@ -64,7 +64,7 @@ class JokeApi {
val logger: Logger by lazy { Logger.getLogger(JokeApi::class.java.simpleName) } val logger: Logger by lazy { Logger.getLogger(JokeApi::class.java.simpleName) }
/** /**
* Use to make a direct API call. * Makes a direct API call.
* *
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#endpoints) for more details. * Sse the [JokeAPI Documentation](https://jokeapi.dev/#endpoints) for more details.
*/ */
@ -102,9 +102,10 @@ class JokeApi {
} }
/** /**
* Use to retrieve a joke. * Retrieves one or more jokes.
* *
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details. * Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details.
* @see [getJoke]
*/ */
@JvmStatic @JvmStatic
@Throws(HttpErrorException::class, IOException::class) @Throws(HttpErrorException::class, IOException::class)
@ -184,7 +185,7 @@ class JokeApi {
} }
/** /**
* Use to retrieve a joke using a [configuration][JokeConfig]. * Retrieves ond or more jokes using a [configuration][JokeConfig].
* *
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details. * Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details.
*/ */
@ -284,11 +285,12 @@ class JokeApi {
} }
/** /**
* Use to retrieve a [Joke]. * Retrieves a [Joke] instance.
* *
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details. * Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details.
* *
* @param splitNewLine Split newline within joke. * @param splitNewLine Split newline within [Type.SINGLE] joke.
* @see [getRawJoke]
*/ */
@JvmStatic @JvmStatic
@Throws(JokeException::class, HttpErrorException::class, IOException::class) @Throws(JokeException::class, HttpErrorException::class, IOException::class)
@ -353,7 +355,7 @@ class JokeApi {
} }
/** /**
* Use to retrieve a [Joke] using a [configuration][JokeConfig]. * Retrieves a [Joke] instance using a [configuration][JokeConfig].
* *
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details. * Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details.
*/ */

View file

@ -57,11 +57,11 @@ class JokeConfig private constructor(
val splitNewLine: Boolean, val splitNewLine: Boolean,
) { ) {
/** /**
* Use to [build] a new configuration. * [Builds][build] a new configuration.
* *
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details. * Sse the [JokeAPI Documentation](https://jokeapi.dev/#joke-endpoint) for more details.
* *
* @param splitNewLine Split newline within joke. * @param splitNewLine Split newline within [Type.SINGLE] joke.
*/ */
data class Builder( data class Builder(
var categories: Set<Category> = setOf(Category.ANY), var categories: Set<Category> = setOf(Category.ANY),

View file

@ -35,7 +35,7 @@ package net.thauvin.erik.jokeapi.exceptions
import java.io.IOException import java.io.IOException
/** /**
* Thrown whenever a server error occurs. * Signals that a server error has occurred.
* *
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#status-codes) for more details. * Sse the [JokeAPI Documentation](https://jokeapi.dev/#status-codes) for more details.
*/ */

View file

@ -33,7 +33,7 @@
package net.thauvin.erik.jokeapi.exceptions package net.thauvin.erik.jokeapi.exceptions
/** /**
* Thrown whenever an error occurs. * Signals that an error has occurred.
* *
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#errors) for more details. * Sse the [JokeAPI Documentation](https://jokeapi.dev/#errors) for more details.
*/ */

View file

@ -33,9 +33,7 @@
package net.thauvin.erik.jokeapi.models package net.thauvin.erik.jokeapi.models
/** /**
* The supported joke categories and aliases, use [ANY] for all. * The supported [categories and aliases](https://jokeapi.dev/#categories), use [ANY] for all.
*
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#categories) for more details.
*/ */
enum class Category(val value: String) { enum class Category(val value: String) {
ANY("Any"), ANY("Any"),

View file

@ -33,9 +33,7 @@
package net.thauvin.erik.jokeapi.models package net.thauvin.erik.jokeapi.models
/** /**
* The supported blacklist flags, use [ALL] to prevent all. * The supported [blacklist flags](https://jokeapi.dev/#flags-param), use [ALL] to prevent all.
*
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#flags-param) for more details.
*/ */
enum class Flag(val value: String) { enum class Flag(val value: String) {
NSFW("nsfw"), NSFW("nsfw"),

View file

@ -33,9 +33,7 @@
package net.thauvin.erik.jokeapi.models package net.thauvin.erik.jokeapi.models
/** /**
* The supported response formats. * The supported response [formats](https://jokeapi.dev/#format-param).
*
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#format-param) for more details.
*/ */
enum class Format(val value: String) { enum class Format(val value: String) {
JSON("json"), XML("xml"), YAML("yaml"), TEXT("txt"), TXT(TEXT.value) JSON("json"), XML("xml"), YAML("yaml"), TEXT("txt"), TXT(TEXT.value)

View file

@ -33,8 +33,6 @@
package net.thauvin.erik.jokeapi.models package net.thauvin.erik.jokeapi.models
/** /**
* Used to specify a joke's ID or range of IDs. * Specifies a joke [ID or range of IDs](https://jokeapi.dev/#idrange-param).
*
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#idrange-param) for more details.
*/ */
data class IdRange(val start: Int = -1, val end: Int = -1) data class IdRange(val start: Int = -1, val end: Int = -1)

View file

@ -33,7 +33,7 @@
package net.thauvin.erik.jokeapi.models package net.thauvin.erik.jokeapi.models
/** /**
* Used to store a joke's data. * Stores a joke's data.
*/ */
data class Joke( data class Joke(
val error: Boolean, val error: Boolean,

View file

@ -33,9 +33,7 @@
package net.thauvin.erik.jokeapi.models package net.thauvin.erik.jokeapi.models
/** /**
* The supported languages. * The supported [languages](https://jokeapi.dev/#lang).
*
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#lang) for more details.
*/ */
enum class Language(val value: String) { enum class Language(val value: String) {
ENGLISH("en"), ENGLISH("en"),

View file

@ -33,9 +33,7 @@
package net.thauvin.erik.jokeapi.models package net.thauvin.erik.jokeapi.models
/** /**
* The URL Parameters. * The available [URL Parameters](https://jokeapi.dev/#url-parameters).
*
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#url-parameters) for more details.
*/ */
object Parameter { object Parameter {
const val AMOUNT = "amount" const val AMOUNT = "amount"

View file

@ -33,9 +33,7 @@
package net.thauvin.erik.jokeapi.models package net.thauvin.erik.jokeapi.models
/** /**
* The supported joke types, use [ALL] for all. * The supported [types](https://jokeapi.dev/#type-param), use [ALL] for all.
*
* Sse the [JokeAPI Documentation](https://jokeapi.dev/#type-param) for more details.
*/ */
enum class Type(val value: String) { enum class Type(val value: String) {
SINGLE("single"), SINGLE("single"),