1
2
3
4
5
6 package fr.paris.lutece.plugins.grubusiness.business.notification;
7
8
9
10
11
12 public class StatusMessage
13 {
14
15 private String _strType;
16 private String _strStatus;
17 private String _strReason;
18 private String _strMessage;
19
20
21
22
23
24
25
26
27
28 public StatusMessage(String _strType, String _strStatus, String _strReason, String _strMessage)
29 {
30 this._strType = _strType;
31 this._strStatus = _strStatus;
32 this._strReason = _strReason;
33 this._strMessage = _strMessage;
34 }
35
36
37
38
39
40
41
42
43 public String getType( )
44 {
45 return _strType;
46 }
47
48
49
50
51
52
53 public void setType(String _strType)
54 {
55 this._strType = _strType;
56 }
57
58
59
60
61
62
63 public String getStatus( )
64 {
65 return _strStatus;
66 }
67
68
69
70
71
72
73 public void setStatus(String _strStatus)
74 {
75 this._strStatus = _strStatus;
76 }
77
78
79
80
81
82
83 public String getReason( )
84 {
85 return _strReason;
86 }
87
88
89
90
91
92
93 public void setReason(String _strReason)
94 {
95 this._strReason = _strReason;
96 }
97
98
99
100
101
102
103 public String getStrMessage( )
104 {
105 return _strMessage;
106 }
107
108
109
110
111
112
113 public void setStrMessage(String _strMessage)
114 {
115 this._strMessage = _strMessage;
116 }
117
118
119
120
121
122
123 public String asJson( )
124 {
125 return "{" +
126 "\"type\":\"" + _strType + "\"," +
127 "\"status\":\"" + _strStatus + "\"," +
128 "\"reason\":\"" + (_strReason == null ? "" : _strReason.replace( "\"","\\\"").replace("\n", "\\\\n").replace("\r", "\\\\r").replace("\t", "\\\\t")) + "\"," +
129 "\"message\":\"" + (_strMessage == null ? "": _strMessage.replace( "\"","\\\"").replace("\n", "\\\\n").replace("\r", "\\\\r").replace("\t", "\\\\t")) + "\"}";
130 }
131
132
133 }