Skip to content

Lab-2: implement class generator#10

Open
Kkkkkk58 wants to merge 8 commits intomasterfrom
review1
Open

Lab-2: implement class generator#10
Kkkkkk58 wants to merge 8 commits intomasterfrom
review1

Conversation

@Kkkkkk58
Copy link

@Kkkkkk58 Kkkkkk58 commented Nov 4, 2025

Хасан Карим Асадович, M4175

NB!
Класс org.example.generator.GeneratableRegistry генерируется процессором аннотаций org.example.annotation.processor.GeneratableProcessor в модуле annotation-processor


public Object generateValueOfType(Class<?> clazz) {
try {
return generateValueOfTypeInternal(clazz, null, 0);
Copy link

Choose a reason for hiding this comment

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

Если на вход дать какую нибудь колллекцию, то кажется отработает некорректно, но я уже засчитал лабу)

Copy link
Author

Choose a reason for hiding this comment

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

при входном параметре, равном условному List.class, выбросим ошибку о том, что мы такие значения генерировать не умеем - а мы и вправду их генерировать не умеем и не должны, вроде всё ок

Copy link

Choose a reason for hiding this comment

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

Хотя по условиям и не требуется конечно

Copy link
Author

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