1 package org.openecomp.sdc.vendorsoftwareproduct.errors;
3 import org.openecomp.sdc.common.errors.ErrorCategory;
4 import org.openecomp.sdc.common.errors.ErrorCode;
5 import org.openecomp.sdc.versioning.dao.types.Version;
8 public class CompositionEditNotAllowedErrorBuilder {
9 private static final String VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG =
10 "Composition entities may not be created / deleted for Vendor Software Product %s, version %s"
11 + "whose entities were uploaded";
12 private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
15 * Instantiates a new error builder.
17 * @param vendorSoftwareProductId the vendor software product id
18 * @param version the version
20 public CompositionEditNotAllowedErrorBuilder(String vendorSoftwareProductId, Version version) {
21 builder.withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
22 builder.withCategory(ErrorCategory.APPLICATION);
24 String.format(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG, vendorSoftwareProductId,
25 version == null ? null : version.toString()));
32 * @return the error code
34 public ErrorCode build() {
35 return builder.build();