[SDC] Onboarding 1710 rebase.
[sdc.git] / openecomp-be / backend / openecomp-sdc-vendor-software-product-manager / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / errors / OnboardingMethodErrorBuilder.java
1 package org.openecomp.sdc.vendorsoftwareproduct.errors;
2
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;
7
8 import org.openecomp.sdc.common.errors.ErrorCategory;
9 import org.openecomp.sdc.common.errors.ErrorCode;
10
11 /**
12  * The type Onboarding method error builder.
13  */
14 public class OnboardingMethodErrorBuilder {
15
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.";
20
21   /**
22    * Gets onboarding update error.
23    *
24    * @return the onboarding update error
25    */
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();
32   }
33
34   /**
35    * Get invalid onboarding method error builder error code.
36    *
37    * @return the error code
38    */
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();
45   }
46 }