Skip to content

Comments

Malik1998 container2#117

Open
Malik1998 wants to merge 33 commits intoarhangeldim:masterfrom
Malik1998:Malik1998-Container2
Open

Malik1998 container2#117
Malik1998 wants to merge 33 commits intoarhangeldim:masterfrom
Malik1998:Malik1998-Container2

Conversation

@Malik1998
Copy link

No description provided.

@arhangeldim
Copy link
Owner

Не понял, зачем новый реквест? Вот же у вас есть ветка #95

Закройте новый, работаем в старом #95

@Malik1998
Copy link
Author

Я просто пул делал в старом, и че то не отображается. Вот и сделал новый

public class Container {

private List<Bean> beans;
private HashMap<String, Object> objByName = new HashMap<String, Object>();
Copy link
Owner

Choose a reason for hiding this comment

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

При объявлении ссылки лучше указывать не реализацию, а интерфейс

Map<T> map = new HashMap();
List list = new ArrayList();

Copy link
Author

Choose a reason for hiding this comment

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

Хорошо исправлю

Object newPropClass1 = getById(property.getValue().toString());
method.invoke(object, newPropClass1);
} else {
int value = Integer.parseInt(property.getValue().toString());
Copy link
Owner

Choose a reason for hiding this comment

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

Нужно обрабатывать поля всех примитивных типов и String

Copy link
Author

Choose a reason for hiding this comment

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

А смысл у нас же нет String, double, float

Copy link
Owner

Choose a reason for hiding this comment

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

Это в данном конфиге нет. А если будет? А в рамках мессенджера точно будут String. Нужно предусмотреть, int - это только пример

Copy link
Author

Choose a reason for hiding this comment

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

А в рамках месенджер мы же можем пользоваться каким-нибудь стандартным классом. На лекции рассказывали, что вроде такой уже давно написан

* Представляет тег bean из конфига
*/
public class Bean {
public class Bean<T extends Map<String, Property>> {
Copy link
Owner

Choose a reason for hiding this comment

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

Для чего здесь параметризация?

Copy link
Author

@Malik1998 Malik1998 Nov 17, 2016

Choose a reason for hiding this comment

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

Чтобы HashMap можно было использовать, просто не хочется везде прописывать

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