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.
this.error = error;
}
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the error that occured.
+ *
+ * @return The error that occured
+ */
+ @VisibleForTesting
+ public String getError() {
+ return error;
+ }
+
}
import com.fasterxml.jackson.databind.node.BooleanNode;
import com.fasterxml.jackson.databind.node.IntNode;
import com.fasterxml.jackson.databind.node.TextNode;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Maps;
/**
}
//
+ // ACCESSORS
+ //
+
+ /**
+ * Returns whether the request was successful.
+ *
+ * @return {@code true} if the request was successful, {@code false} otherwise
+ */
+ @VisibleForTesting
+ public boolean isSuccess() {
+ return success;
+ }
+
+ /**
+ * Returns the value stored under the given key.
+ *
+ * @param key
+ * The key of the value to retrieve
+ * @return The value of the key, or {@code null} if there is no value for the
+ * given key
+ */
+ @VisibleForTesting
+ public JsonNode get(String key) {
+ return content.get(key);
+ }
+
+ //
// ACTIONS
//