1c728bdfbb88483ef9acfb3078e35238f5740429
[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 /**
7  * The Compute error builder.
8  */
9 public class ComputeErrorBuilder {
10     private static final String COMPUTE_NAME_FORMAT_MSG = "Field does not conform to predefined criteria"
11             + ": name : must match %s";
12
13     /**
14      * Gets image name format error builder.
15      *
16      * @return the image name format error builder
17      */
18     public static ErrorCode getComputeNameFormatErrorBuilder(String pattern) {
19         ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
20         builder.withId(VendorSoftwareProductErrorCodes.COMPUTE_NAME_FORMAT_NOT_ALLOWED);
21         builder.withCategory(ErrorCategory.APPLICATION);
22         builder.withMessage(String.format(COMPUTE_NAME_FORMAT_MSG, pattern));
23         return builder.build();
24     }
25 }