1 package org.openecomp.sdc.vendorsoftwareproduct.errors;
3 import org.openecomp.sdc.common.errors.ErrorCategory;
4 import org.openecomp.sdc.common.errors.ErrorCode;
6 public class DuplicateNicInComponentErrorBuilder {
8 private static final String DUPLICATE_NIC_NAME_NOT_ALLOWED_MSG =
9 "Invalid request, NIC with name %s already exist for component with ID %s.";
11 private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
13 public DuplicateNicInComponentErrorBuilder(String nicName, String componentId ){
14 builder.withId(VendorSoftwareProductErrorCodes.DUPLICATE_NIC_NAME_NOT_ALLOWED);
15 builder.withCategory(ErrorCategory.APPLICATION);
16 builder.withMessage(String.format(DUPLICATE_NIC_NAME_NOT_ALLOWED_MSG,nicName,componentId));
18 public ErrorCode build() {
19 return builder.build();