diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java index a11092bbe3..6164d5eb5a 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.vendorlicense.errors; import org.openecomp.sdc.common.errors.ErrorCategory; @@ -25,27 +24,22 @@ import org.openecomp.sdc.common.errors.ErrorCode; public class JsonErrorBuilder { - private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID = - "JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID"; - private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG = - "Json error occured during artifact generation:%s."; - - private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - - /** - * Instantiates a new Json error builder. - * - * @param exceptionMessage the exception message - */ - public JsonErrorBuilder(String exceptionMessage) { - builder.withId(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID); - builder.withCategory(ErrorCategory.APPLICATION); - builder.withMessage( - String.format(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG, exceptionMessage)); - } - - public ErrorCode build() { - return builder.build(); - } - + private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID = "JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID"; + private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG = "Json error occured during artifact generation:%s."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Json error builder. + * + * @param exceptionMessage the exception message + */ + public JsonErrorBuilder(String exceptionMessage) { + builder.withId(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG, exceptionMessage)); + } + + public ErrorCode build() { + return builder.build(); + } } |