From 1114ac09c29f29c4194f4ac9616d66d282e46329 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 14 Sep 2017 19:56:13 +0200 Subject: [PATCH] Replace error return object with Kotlin version --- .../sone/web/ajax/JsonErrorReturnObject.java | 46 ---------------------- .../sone/web/ajax/JsonErrorReturnObject.kt | 6 +++ 2 files changed, 6 insertions(+), 46 deletions(-) delete mode 100644 src/main/java/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.java create mode 100644 src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.kt diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.java b/src/main/java/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.java deleted file mode 100644 index 4612f0c..0000000 --- a/src/main/java/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * © 2013 xplosion interactive - */ - -package net.pterodactylus.sone.web.ajax; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.VisibleForTesting; - -/** - * {@link JsonReturnObject} that signals an error has occured. - * - * @author David Roden - */ -public class JsonErrorReturnObject extends JsonReturnObject { - - /** The error that has occured. */ - @JsonProperty - private final String error; - - /** - * Creates a new error JSON return object. - * - * @param error - * The error that occured - */ - public JsonErrorReturnObject(String error) { - super(false); - this.error = error; - } - - // - // ACCESSORS - // - - /** - * Returns the error that occured. - * - * @return The error that occured - */ - @VisibleForTesting - public String getError() { - return error; - } - -} diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.kt new file mode 100644 index 0000000..535a3d0 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.kt @@ -0,0 +1,6 @@ +package net.pterodactylus.sone.web.ajax + +/** + * [JsonReturnObject] that signals an error has occured. + */ +data class JsonErrorReturnObject(val error: String) : JsonReturnObject(false) -- 2.7.4