1 package org.onap.sdc.dcae.errormng;
3 import com.fasterxml.jackson.annotation.JsonInclude;
7 @JsonInclude(JsonInclude.Include.NON_NULL)
8 public class RequestError {
9 private PolicyException policyException;
10 private ServiceException serviceException;
11 private OkResponseInfo okResponseInfo;
12 private List<ServiceException> serviceExceptions;
14 public PolicyException getPolicyException() {
15 return policyException;
18 public ServiceException getServiceException() {
19 return serviceException;
22 public OkResponseInfo getOkResponseInfo() {
23 return okResponseInfo;
26 public void setPolicyException(PolicyException policyException) {
27 this.policyException = policyException;
30 void setServiceException(ServiceException serviceException) {
31 this.serviceException = serviceException;
34 void setOkResponseInfo(OkResponseInfo okResponseInfo) {
35 this.okResponseInfo = okResponseInfo;
38 public List<ServiceException> getServiceExceptions() {
39 return serviceExceptions;
42 void setServiceExceptions(List<ServiceException> serviceExceptions) {
43 this.serviceExceptions = serviceExceptions;
46 String getFormattedMessage() {
47 return getError().getFormattedErrorMessage();
50 String getMessageId() {
51 return getError().getMessageId();
54 String[] getVariables() {
55 return getError().getVariables();
59 return getError().getText();
62 AbstractSdncException getError() {
63 return null != serviceException ? serviceException : null != policyException ? policyException : okResponseInfo;