Creating instance of generic objects
Javonet allows you to create instances of generic objects. To initialize generic class first type with expected generic type should be created. Next to initialize the instance of generic type call the "create()" method on the object.
Important Notice that while initializing NType for generic class there is apostrophe with number of generic arguments provided which let's Javonet recognize which generic class should be initialized. For example for List
To create instance of generic class:
Was this article helpful?