45989ddbf0f55a52e02115069a7b7189466e4afa
[sdc.git] /
1 package org.openecomp.sdc.vendorsoftwareproduct.dao.errors;
2
3 import org.openecomp.sdc.common.errors.ErrorCategory;
4 import org.openecomp.sdc.common.errors.ErrorCode;
5 import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
6 import org.openecomp.sdc.versioning.dao.types.Version;
7
8 import java.text.MessageFormat;
9
10 public class VendorSoftwareProductCreationFailedBuilder {
11   private static final String VSP_CREATION_FAILED = "Failed to create VSP; %s";
12   private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
13
14   /**
15    * Instantiates a new Vendor software product creation failed error builder.
16    *
17    */
18   public VendorSoftwareProductCreationFailedBuilder(String reason) {
19     builder.withId(VendorSoftwareProductErrorCodes.FAILED_TO_CREATE_VSP);
20     builder.withCategory(ErrorCategory.APPLICATION);
21     builder
22         .withMessage(String.format(VSP_CREATION_FAILED, reason));
23   }
24
25   public ErrorCode build() {
26     return builder.build();
27   }
28 }