2 * Copyright © 2017-2018 AT&T Intellectual Property.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.ccsdk.cds.controllerblueprints.service.common;
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;
25 import java.io.Serializable;
26 import java.util.Date;
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;
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();
38 public ErrorMessage(String message, Integer code, String debugMessage){
39 this.message = message;
41 this.debugMessage = debugMessage;
44 public String getMessage() {
48 public void setMessage(String message) {
49 this.message = message;
52 public Integer getCode() {
56 public void setCode(Integer code) {
60 public String getDebugMessage() {
64 public void setDebugMessage(String developerMessage) {
65 this.debugMessage = developerMessage;
68 public Date getTimestamp() {
72 public void setTimestamp(Date timestamp) {
73 this.timestamp = timestamp;