Generics of fields

In the case of fields (for example, slices), generics can be fetched via Field.getGenericType(), as follows:

Field slicesField = clazz.getDeclaredField("slices");
Type slicesType = slicesField.getGenericType();

Calling printGenerics(slicesType) will output the following:

Class of type argument: class modern.challenge.Slice
Simple name of type argument: Slice
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.54.255