1 package org.openecomp.sdc.vendorsoftwareproduct.errors;
3 import org.openecomp.sdc.common.errors.ErrorCategory;
4 import org.openecomp.sdc.common.errors.ErrorCode;
6 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NIC_NAME_FORMAT_NOT_ALLOWED;
9 * The NIC error builder.
11 public class NicErrorBuilder {
12 private static final String NIC_NAME_FORMAT_MSG = "Field does not conform to predefined criteria"
13 + ": name : must match %s";
16 * Gets image name format error builder.
18 * @return the image name format error builder
20 public static ErrorCode getNicNameFormatErrorBuilder(String imageName, String pattern) {
21 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
22 builder.withId(NIC_NAME_FORMAT_NOT_ALLOWED);
23 builder.withCategory(ErrorCategory.APPLICATION);
24 builder.withMessage(String.format(NIC_NAME_FORMAT_MSG, pattern));
25 return builder.build();