diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java index a8aeb17a51..334639db0e 100644 --- a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java +++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.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.datatypes.error; import java.util.ArrayList; @@ -32,38 +31,35 @@ import org.apache.commons.collections4.CollectionUtils; @EqualsAndHashCode @ToString public class ErrorMessage { - private final ErrorLevel level; - private final String message; - - public ErrorMessage(ErrorLevel level, String message) { - this.level = level; - this.message = message; - } - public static class ErrorMessageUtil { + private final ErrorLevel level; + private final String message; - private ErrorMessageUtil() { + public ErrorMessage(ErrorLevel level, String message) { + this.level = level; + this.message = message; } - /** - * Add message list. - * - * @param fileName the file name - * @param errorMap the error map - * @return the list - */ - public static List<ErrorMessage> addMessage(String fileName, - Map<String, List<ErrorMessage>> errorMap) { - List<ErrorMessage> fileErrorList; - fileErrorList = errorMap.get(fileName); - if (CollectionUtils.isEmpty(fileErrorList)) { - fileErrorList = new ArrayList<>(); - errorMap.put(fileName, fileErrorList); - } - - return fileErrorList; - } - } + public static class ErrorMessageUtil { + private ErrorMessageUtil() { + } + /** + * Add message list. + * + * @param fileName the file name + * @param errorMap the error map + * @return the list + */ + public static List<ErrorMessage> addMessage(String fileName, Map<String, List<ErrorMessage>> errorMap) { + List<ErrorMessage> fileErrorList; + fileErrorList = errorMap.get(fileName); + if (CollectionUtils.isEmpty(fileErrorList)) { + fileErrorList = new ArrayList<>(); + errorMap.put(fileName, fileErrorList); + } + return fileErrorList; + } + } } |