1 package org.openecomp.sdc.vendorsoftwareproduct.errors;
3 import org.openecomp.sdc.common.errors.ErrorCategory;
4 import org.openecomp.sdc.common.errors.ErrorCode;
7 * The Compute error builder.
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";
14 * Gets image name format error builder.
16 * @return the image name format error builder
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();