Excluded empty fields, during marshalling of error-messages
[facebook-errors] / src / main / java / de / juplo / facebook / errors / FacebookErrorMessage.java
1 package de.juplo.facebook.errors;
2
3
4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5 import com.fasterxml.jackson.annotation.JsonInclude;
6 import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
7 import com.fasterxml.jackson.annotation.JsonProperty;
8 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
9 import com.fasterxml.jackson.annotation.JsonRootName;
10
11
12
13 /**
14  * This class represents an error message from the Graph-API
15  *
16  * @see <a href="https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5#errors">Graph-API Documentation</a>
17  * @author Kai Moritz
18  */
19 @JsonRootName("error")
20 @JsonPropertyOrder({
21   "message",
22   "type",
23   "code",
24   "error_subcode",
25   "error_user_title",
26   "error_user_msg",
27   "fbtrace_id"
28   })
29 @JsonIgnoreProperties(ignoreUnknown = true)
30 public class FacebookErrorMessage
31 {
32   @JsonProperty("message")
33   @JsonInclude(NON_EMPTY)
34   String message;
35   @JsonProperty("type")
36   @JsonInclude(NON_EMPTY)
37   String type;
38   @JsonProperty("code")
39   @JsonInclude(NON_EMPTY)
40   Integer code;
41   @JsonProperty("error_subcode")
42   @JsonInclude(NON_EMPTY)
43   Integer subCode;
44   @JsonProperty("error_user_title")
45   @JsonInclude(NON_EMPTY)
46   String userTitle;
47   @JsonProperty("error_user_msg")
48   @JsonInclude(NON_EMPTY)
49   String userMessage;
50   @JsonProperty("fbtrace_id")
51   @JsonInclude(NON_EMPTY)
52   String traceId;
53   @JsonProperty("is_transient")
54   @JsonInclude(NON_EMPTY)
55   Boolean isTransient;
56 }