3838import com .microsoft .graph .http .IRequestBuilder ;
3939import com .microsoft .graph .logger .ILogger ;
4040
41- // those imports are useless but build will fail if code-gen conventions change, keep it
41+ // keep these imports: even though they are not used, it's a good way to call
42+ // for maintainer's attention en the event code generation naming conventions
43+ // change. If the name change, these import will build at build time rather than
44+ // reflection building at run time.
4245import com .microsoft .graph .models .extensions .Attachment ;
4346import com .microsoft .graph .requests .extensions .AttachmentCollectionPage ;
4447import com .microsoft .graph .requests .extensions .AttachmentCollectionResponse ;
@@ -104,7 +107,9 @@ public static <T1, T2 extends IRequestBuilder> BaseCollectionPage<T1, T2> deseri
104107 serializer = new DefaultSerializer (logger );
105108 final JsonObject [] sourceArray = serializer .deserializeObject (json .toString (), JsonObject [].class );
106109 final ArrayList <T1 > list = new ArrayList <T1 >(sourceArray .length );
110+ /** eg: com.microsoft.graph.requests.extensions.AttachmentCollectionPage */
107111 final String collectionPageClassCanonicalName = typeOfT .getTypeName ();
112+ /** eg: com.microsoft.graph.models.extensions.Attachment */
108113 final String entityClassCanonicalName = collectionPageClassCanonicalName
109114 .substring (0 , collectionPageClassCanonicalName .length () - pageLength - collectionLength )
110115 .replace ("requests" , "models" );
@@ -115,12 +120,14 @@ public static <T1, T2 extends IRequestBuilder> BaseCollectionPage<T1, T2> deseri
115120 ((IJsonBackedObject )targetObject ).setRawObject (serializer , sourceObject );
116121 list .add (targetObject );
117122 }
123+ /** eg: com.microsoft.graph.requests.extensions.AttachmentCollectionResponse */
118124 final String responseClassCanonicalName = collectionPageClassCanonicalName
119125 .substring (0 , collectionPageClassCanonicalName .length () - pageLength ) + "Response" ;
120126 final Class <?> responseClass = Class .forName (responseClassCanonicalName );
121127 final Object response = responseClass .getConstructor ().newInstance ();
122128 responseClass .getField ("value" ).set (response , list );
123129 final Class <?> collectionPageClass = Class .forName (collectionPageClassCanonicalName );
130+ /** eg: com.microsoft.graph.requests.extensions.IAttachmentCollectionRequestBuilder */
124131 final String responseBuilderInterfaceCanonicalName = responseClassCanonicalName
125132 .substring (0 , responseClassCanonicalName .length () - responseLength )
126133 .replace (extensionsPath , extensionsPath + "I" ) + "RequestBuilder" ;
0 commit comments