From beb752c6722e2e5603272159856d1995fb828344 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 19 Sep 2019 12:12:01 -0700 Subject: [PATCH] Updated javadoc. --- .../net/thauvin/erik/akismet/Akismet.kt | 67 +++++++++++++------ 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt index 828986d..1d69e68 100644 --- a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt +++ b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt @@ -43,7 +43,14 @@ import java.util.logging.Logger import javax.servlet.http.HttpServletRequest /** - * Akismet Kotlin/Java Client Library + * A small Kotlin/Java library for accessing the Akismet service. + * + * @constructor Creates a new instance. + * + * @param apiKey The [Akismet](https://www.askimet.com/) API key. + * @param blog The URL registered with Akismet. + * + * @author [Erik C. Thauvin](https://erik.thauvin.net/) */ @Version(properties = "version.properties", type = "kt") open class Akismet(apiKey: String, blog: String) { @@ -75,17 +82,38 @@ open class Akismet(apiKey: String, blog: String) { private var client: OkHttpClient var isValidKey: Boolean = false + /** + * Check if the API Key has been verified. + */ + var isVerifiedKey: Boolean = false private set + + /** + * The HTTP status code of the last operation. + */ + private set + /** + * The X-akismet-pro-tip header from the last operation, if any. + */ @Suppress("MemberVisibilityCanBePrivate") var proTip: String = "" private set + /** + * The X-akismet-error header from the last operation, if any. + */ @Suppress("MemberVisibilityCanBePrivate") var error: String = "" private set + /** + * The X-akismet-debug-help header from the last operation, if any. + */ @Suppress("MemberVisibilityCanBePrivate") var degugHelp: String = "" private set + /** + * The logger instance. + */ val logger: Logger by lazy { Logger.getLogger(Akismet::class.java.simpleName) } init { @@ -109,9 +137,8 @@ open class Akismet(apiKey: String, blog: String) { } /** - * Key Verification - * - * @see Akismet API + * Key Verification. + * See the [Akismet API](https://akismet.com/development/api/#verify-key) for more details. */ fun verifyKey(): Boolean { val params = HashMap() @@ -122,9 +149,9 @@ open class Akismet(apiKey: String, blog: String) { } /** - * Comment Check using [HttpServletRequest][request] content. - * - * @see Akismet API + * Comment Check using the content of a + * [HttpServletRequest](https://javaee.github.io/javaee-spec/javadocs/javax/servlet/http/HttpServletRequest.html). + * See the [Akismet API](https://akismet.com/development/api/#comment-check) for more details. */ @JvmOverloads fun checkComment( @@ -165,9 +192,7 @@ open class Akismet(apiKey: String, blog: String) { } /** - * Comment Check - * - * @see Akismet API + * Comment Check. See the [Akismet API](https://akismet.com/development/api/#comment-check) for more details. */ @JvmOverloads fun checkComment( @@ -215,9 +240,9 @@ open class Akismet(apiKey: String, blog: String) { } /** - * Submit Spam - * - * @see Akismet API + * Submit Spam (missed spam) using the content of a + * [HttpServletRequest](https://javaee.github.io/javaee-spec/javadocs/javax/servlet/http/HttpServletRequest.html). + * See the [Akismet API](https://akismet.com/development/api/#submit-spam) for more details. */ @JvmOverloads fun submitSpam( @@ -258,9 +283,8 @@ open class Akismet(apiKey: String, blog: String) { } /** - * Submit Spam (missed spam) - * - * @see Akismet API + * Submit Spam (missed spam). + * See the [Akismet API](https://akismet.com/development/api/#submit-spam) for more details. */ @JvmOverloads fun submitSpam( @@ -305,9 +329,9 @@ open class Akismet(apiKey: String, blog: String) { } /** - * Submit Ham (false positives) - * - * @see Akismet API + * Submit Ham (false positives) using the content of a + * [HttpServletRequest](https://javaee.github.io/javaee-spec/javadocs/javax/servlet/http/HttpServletRequest.html). + * See the [Akismet API](https://akismet.com/development/api/#submit-ham) for more details. */ @JvmOverloads fun submitHam( @@ -348,9 +372,8 @@ open class Akismet(apiKey: String, blog: String) { } /** - * Submit Ham - * - * @see Akismet API + * Submit Ham. + * See the [Akismet API](https://akismet.com/development/api/#submit-ham) for more details. */ @JvmOverloads fun submitHam(