import org.apache.commons.lang.StringUtils;
import org.openecomp.core.converter.errors.CreateToscaObjectErrorBuilder;
import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
import java.lang.reflect.Field;
import java.util.HashSet;
private static final String DEFAULT_CAPITAL = "Default";
private static Set<String> defaultValueKeys;
+ private static Logger LOGGER = LoggerFactory.getLogger(ToscaConverterUtil.class.getName());
+
static {
defaultValueKeys =
Stream.of(DEFAULT, DEFAULT_CAPITAL).collect(Collectors.toSet());
Class<T> classToCreate) {
try {
return createObjectUsingSetters(objectCandidate, classToCreate);
- } catch (Exception e) {
+ } catch (Exception ex) {
throw new CoreException(
- new CreateToscaObjectErrorBuilder(classToCreate.getSimpleName(), objectId, e.getMessage())
- .build());
+ new CreateToscaObjectErrorBuilder(classToCreate.getSimpleName(), objectId)
+ .build(), ex);
}
}
return Objects.nonNull(fieldValueToAssign)
&& Objects.nonNull(classToCreate.getMethod(methodName, field.getType()));
} catch (NoSuchMethodException e) {
+ LOGGER.debug(String.format("Could not extract method '%s' from class '%s'. returning false " +
+ "with filedType '%s'.", methodName, classToCreate, field.getType()), e);
return false;
}
}