Fixed SONAR issues
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-core / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / dao / errors / VendorSoftwareProductCreationFailedBuilder.java
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
7 public class VendorSoftwareProductCreationFailedBuilder {
8   private static final String VSP_CREATION_FAILED = "Failed to create VSP; %s";
9   private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
10
11   /**
12    * Instantiates a new Vendor software product creation failed error builder.
13    *
14    */
15   public VendorSoftwareProductCreationFailedBuilder(String reason) {
16     builder.withId(VendorSoftwareProductErrorCodes.FAILED_TO_CREATE_VSP);
17     builder.withCategory(ErrorCategory.APPLICATION);
18     builder
19         .withMessage(String.format(VSP_CREATION_FAILED, reason));
20   }
21
22   public ErrorCode build() {
23     return builder.build();
24   }
25 }