f9a3da2e750f7eede274d9999c47e28963deaac9
[sdc.git] /
1 package org.openecomp.core.converter.errors;
2
3 import org.openecomp.sdc.common.errors.BaseErrorBuilder;
4 import org.openecomp.sdc.common.errors.ErrorCategory;
5
6 public class CreateToscaObjectErrorBuilder extends BaseErrorBuilder {
7   private static final String CANT_CREATE_OBJECT_FROM_CLASS =
8       "Can't create %s from %s. Reason - %s";
9   private static final String IMPORT_TOSCA = "IMPORT_TOSCA";
10
11   public CreateToscaObjectErrorBuilder(String className,
12                                        String objectId,
13                                        String reason) {
14     getErrorCodeBuilder()
15         .withId(IMPORT_TOSCA)
16         .withCategory(ErrorCategory.APPLICATION)
17         .withMessage(String.format(CANT_CREATE_OBJECT_FROM_CLASS, className, objectId, reason));
18   }
19 }