1 package org.openecomp.sdc.vendorsoftwareproduct.errors;
3 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
4 .VSP_INVALID_ONBOARDING_METHOD;
5 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
6 .VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED;
8 import org.openecomp.sdc.common.errors.ErrorCategory;
9 import org.openecomp.sdc.common.errors.ErrorCode;
12 * The type Onboarding method error builder.
14 public class OnboardingMethodErrorBuilder {
16 private static final String VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED_MSG =
17 "onboardingMethod update is not allowed.";
18 private static final String VSP_INVALID_ONBOARDING_METHOD_MSG =
19 "The onboardingMethod value doesn't meet the expected attribute value.";
22 * Gets onboarding update error.
24 * @return the onboarding update error
26 public static ErrorCode getOnboardingUpdateError() {
27 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
28 builder.withId(VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED);
29 builder.withCategory(ErrorCategory.APPLICATION);
30 builder.withMessage(String.format(VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED_MSG));
31 return builder.build();
35 * Get invalid onboarding method error builder error code.
37 * @return the error code
39 public static ErrorCode getInvalidOnboardingMethodErrorBuilder() {
40 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
41 builder.withId(VSP_INVALID_ONBOARDING_METHOD);
42 builder.withCategory(ErrorCategory.APPLICATION);
43 builder.withMessage(String.format(VSP_INVALID_ONBOARDING_METHOD_MSG));
44 return builder.build();