Merge remote-tracking branch 'beak/next' into next
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / JsonErrorReturnObject.java
1 /*
2  * © 2013 xplosion interactive
3  */
4
5 package net.pterodactylus.sone.web.ajax;
6
7 import com.fasterxml.jackson.annotation.JsonProperty;
8 import com.google.common.annotations.VisibleForTesting;
9
10 /**
11  * {@link JsonReturnObject} that signals an error has occured.
12  *
13  * @author <a href="mailto:d.roden@xplosion.de">David Roden</a>
14  */
15 public class JsonErrorReturnObject extends JsonReturnObject {
16
17         /** The error that has occured. */
18         @JsonProperty
19         private final String error;
20
21         /**
22          * Creates a new error JSON return object.
23          *
24          * @param error
25          *              The error that occured
26          */
27         public JsonErrorReturnObject(String error) {
28                 super(false);
29                 this.error = error;
30         }
31
32         //
33         // ACCESSORS
34         //
35
36         /**
37          * Returns the error that occured.
38          *
39          * @return The error that occured
40          */
41         @VisibleForTesting
42         public String getError() {
43                 return error;
44         }
45
46 }