c0ffc40df13ccc8ba89b5c90a5787523bc661de6
[sdc.git] /
1 package org.openecomp.sdc.vendorsoftwareproduct.errors;
2
3 import org.openecomp.sdc.common.errors.ErrorCategory;
4 import org.openecomp.sdc.common.errors.ErrorCode;
5
6 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NIC_NAME_FORMAT_NOT_ALLOWED;
7
8 /**
9  * The NIC error builder.
10  */
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";
14
15     private NicErrorBuilder() {
16
17     }
18
19     /**
20      * Gets image name format error builder.
21      *
22      * @return the image name format error builder
23      */
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();
30     }
31 }