diff options
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java')
1 files changed, 24 insertions, 28 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java index 04038fe6bc..39752b39e7 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,38 +17,34 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.vendorsoftwareproduct.errors; +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.CREATE_PACKAGE_FOR_NON_FINAL_VSP; + import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.versioning.dao.types.Version; -import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.CREATE_PACKAGE_FOR_NON_FINAL_VSP; - - public class CreatePackageForNonFinalVendorSoftwareProductErrorBuilder { - private static final String CREATE_PACKAGE_FOR_NON_FINAL_VSP_MSG = - "Package creation for vendor software product with id %s and version %s is not allowed since " - + "it is not final (submitted)."; - private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - - /** - * Instantiates a new Create package for non final vendor software product error builder. - * - * @param vendorSoftwareProductId the vendor software product id - * @param version the version - */ - public CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(String vendorSoftwareProductId, - Version version) { - builder.withId(CREATE_PACKAGE_FOR_NON_FINAL_VSP); - builder.withCategory(ErrorCategory.APPLICATION); - builder.withMessage(String - .format(CREATE_PACKAGE_FOR_NON_FINAL_VSP_MSG, vendorSoftwareProductId, version == null ? null : version.toString())); - } - - public ErrorCode build() { - return builder.build(); - } + private static final String CREATE_PACKAGE_FOR_NON_FINAL_VSP_MSG = + "Package creation for vendor software product with id %s and version %s is not allowed since " + "it is not final (submitted)."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Create package for non final vendor software product error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + */ + public CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(String vendorSoftwareProductId, Version version) { + builder.withId(CREATE_PACKAGE_FOR_NON_FINAL_VSP); + builder.withCategory(ErrorCategory.APPLICATION); + builder + .withMessage(String.format(CREATE_PACKAGE_FOR_NON_FINAL_VSP_MSG, vendorSoftwareProductId, version == null ? null : version.toString())); + } + + public ErrorCode build() { + return builder.build(); + } } |