Migrate "ms/controllerblueprints" from ccsdk/apps
[ccsdk/cds.git] / ms / controllerblueprints / modules / service / src / main / java / org / onap / ccsdk / cds / controllerblueprints / service / common / ErrorMessage.java
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.ccsdk.cds.controllerblueprints.service.common;
18
19 import com.fasterxml.jackson.annotation.JsonFormat;
20 import com.fasterxml.jackson.annotation.JsonInclude;
21 import com.fasterxml.jackson.annotation.JsonInclude.Include;
22 import com.fasterxml.jackson.annotation.JsonTypeInfo;
23 import com.fasterxml.jackson.annotation.JsonTypeName;
24
25 import java.io.Serializable;
26 import java.util.Date;
27
28 @JsonInclude(Include.NON_NULL)
29 @JsonTypeName("errorMessage")
30 @JsonTypeInfo(include= JsonTypeInfo.As.WRAPPER_OBJECT, use=JsonTypeInfo.Id.NAME)
31 public class ErrorMessage implements Serializable {
32     private String message;
33     private Integer code;
34     private String debugMessage;
35     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
36     private Date timestamp = new Date();
37
38     public ErrorMessage(String message, Integer code, String debugMessage){
39         this.message = message;
40         this.code = code;
41         this.debugMessage = debugMessage;
42     }
43
44     public String getMessage() {
45         return message;
46     }
47
48     public void setMessage(String message) {
49         this.message = message;
50     }
51
52     public Integer getCode() {
53         return code;
54     }
55
56     public void setCode(Integer code) {
57         this.code = code;
58     }
59
60     public String getDebugMessage() {
61         return debugMessage;
62     }
63
64     public void setDebugMessage(String developerMessage) {
65         this.debugMessage = developerMessage;
66     }
67
68     public Date getTimestamp() {
69         return timestamp;
70     }
71
72     public void setTimestamp(Date timestamp) {
73         this.timestamp = timestamp;
74     }
75 }