Skip to content

Conversation

@kostet19940308
Copy link

Done Container

Object createdObject = classOfBean.getConstructor().newInstance();
for (Map.Entry<String, Property> entry : bean.getProperties().entrySet()) {
for (Field field : createdObject.getClass().getDeclaredFields()) {
if (field.getName().equals(entry.getKey())) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

очень много вложенных условий
можно этого избегать
if (!field.getName().equals(entry.getKey)){
continue;
}

if (entry.getValue().getType() == ValueType.VAL) {
field.setAccessible(true);
String value = entry.getValue().getValue();
switch (field.getType().getTypeName().toLowerCase()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

большой метод. можно разбить - вынести switch-case в отдельный метод

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants