Skip to content

Лаб 2 - Денисов В. А.#11

Open
vladdenisov wants to merge 6 commits intomasterfrom
master
Open

Лаб 2 - Денисов В. А.#11
vladdenisov wants to merge 6 commits intomasterfrom
master

Conversation

@vladdenisov
Copy link

No description provided.

// В конструкторе заполняем параметры пустыми коллекциями,
// так как могут быть, например, бизнес-валидации в конструкторе.
// Наполняем объект уже после инициализации.
if (Collection.class.isAssignableFrom(rawType)) {
Copy link

Choose a reason for hiding this comment

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

А что если я скажу, что кажется таки есть способ создавать не пустые коллекции и получать тип? Можете посмотреть на наследников Type или поресерчить работы некоторых одногруппников

return map;
}

private Object generateCollectionElement(Class<?> elementClass, int depth) throws InvocationTargetException, InstantiationException, IllegalAccessException {
Copy link

Choose a reason for hiding this comment

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

Если не ошибаюсь мы чуть чуть обсуждали, что у вас много по сути одинаковых методов, ведь элементы внутри коллекций ничем от обычных не отличаются. Переделывать не обязательно, но расскажите как бы вы переписали свой код примерно

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

Comments