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";
15 private NicErrorBuilder() {
20 * Gets image name format error builder.
22 * @return the image name format error builder
24 public static ErrorCode getNicNameFormatErrorBuilder(String pattern) {
25 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
26 builder.withId(NIC_NAME_FORMAT_NOT_ALLOWED);
27 builder.withCategory(ErrorCategory.APPLICATION);
28 builder.withMessage(String.format(NIC_NAME_FORMAT_MSG, pattern));
29 return builder.build();