Skip to content

Commit 55d8d76

Browse files
committed
- fixes generic type casing
1 parent a1b7d30 commit 55d8d76

7 files changed

Lines changed: 34 additions & 34 deletions

File tree

‎src/main/java/com/microsoft/graph/core/BaseClient.java‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444

4545
/**
4646
* A client that communications with an OData service
47-
* @param <NativeRequestType> type of a request for the native http client
47+
* @param <nativeRequestType> type of a request for the native http client
4848
*/
49-
public class BaseClient<NativeRequestType> implements IBaseClient<NativeRequestType> {
49+
public class BaseClient<nativeRequestType> implements IBaseClient<nativeRequestType> {
5050
/**
5151
* Restricted constructor
5252
*/
@@ -140,11 +140,11 @@ public static <nativeClient, nativeRequest> Builder<nativeClient, nativeRequest>
140140
/**
141141
* Builder to help configure the Graph service client
142142
* @param <httpClientType> type of the native http library client
143-
* @param <NativeRequestType> type of a request for the native http client
143+
* @param <nativeRequestType> type of a request for the native http client
144144
*/
145-
public static class Builder<httpClientType, NativeRequestType> {
145+
public static class Builder<httpClientType, nativeRequestType> {
146146
private ISerializer serializer;
147-
private IHttpProvider<NativeRequestType> httpProvider;
147+
private IHttpProvider<nativeRequestType> httpProvider;
148148
private ILogger logger;
149149
private httpClientType httpClient;
150150
private IAuthenticationProvider auth;
@@ -179,9 +179,9 @@ private httpClientType getHttpClient() {
179179
}
180180
}
181181
@SuppressWarnings("unchecked")
182-
private IHttpProvider<NativeRequestType> getHttpProvider() {
182+
private IHttpProvider<nativeRequestType> getHttpProvider() {
183183
if(httpProvider == null) {
184-
return (IHttpProvider<NativeRequestType>)new CoreHttpProvider(getSerializer(), getLogger(), (OkHttpClient)getHttpClient());
184+
return (IHttpProvider<nativeRequestType>)new CoreHttpProvider(getSerializer(), getLogger(), (OkHttpClient)getHttpClient());
185185
} else {
186186
return httpProvider;
187187
}
@@ -195,7 +195,7 @@ private IHttpProvider<NativeRequestType> getHttpProvider() {
195195
* @return the instance of this builder
196196
*/
197197
@Nonnull
198-
public Builder<httpClientType, NativeRequestType> serializer(@Nonnull final ISerializer serializer) {
198+
public Builder<httpClientType, nativeRequestType> serializer(@Nonnull final ISerializer serializer) {
199199
checkNotNull(serializer, "serializer");
200200
this.serializer = serializer;
201201
return this;
@@ -209,7 +209,7 @@ public Builder<httpClientType, NativeRequestType> serializer(@Nonnull final ISer
209209
* @return the instance of this builder
210210
*/
211211
@Nonnull
212-
public Builder<httpClientType, NativeRequestType> httpProvider(@Nonnull final IHttpProvider<NativeRequestType> httpProvider) {
212+
public Builder<httpClientType, nativeRequestType> httpProvider(@Nonnull final IHttpProvider<nativeRequestType> httpProvider) {
213213
checkNotNull(httpProvider, "httpProvider");
214214
this.httpProvider = httpProvider;
215215
return this;
@@ -223,7 +223,7 @@ public Builder<httpClientType, NativeRequestType> httpProvider(@Nonnull final IH
223223
* @return the instance of this builder
224224
*/
225225
@Nonnull
226-
public Builder<httpClientType, NativeRequestType> logger(@Nonnull final ILogger logger) {
226+
public Builder<httpClientType, nativeRequestType> logger(@Nonnull final ILogger logger) {
227227
checkNotNull(logger, "logger");
228228
this.logger = logger;
229229
return this;
@@ -237,7 +237,7 @@ public Builder<httpClientType, NativeRequestType> logger(@Nonnull final ILogger
237237
* @return the instance of this builder
238238
*/
239239
@Nonnull
240-
public Builder<httpClientType, NativeRequestType> httpClient(@Nonnull final httpClientType client) {
240+
public Builder<httpClientType, nativeRequestType> httpClient(@Nonnull final httpClientType client) {
241241
checkNotNull(client, "client");
242242
this.httpClient = client;
243243
return this;
@@ -250,7 +250,7 @@ public Builder<httpClientType, NativeRequestType> httpClient(@Nonnull final http
250250
* @return the instance of this builder
251251
*/
252252
@Nonnull
253-
public Builder<httpClientType, NativeRequestType> authenticationProvider(@Nonnull final IAuthenticationProvider auth) {
253+
public Builder<httpClientType, nativeRequestType> authenticationProvider(@Nonnull final IAuthenticationProvider auth) {
254254
checkNotNull(auth, "auth");
255255
this.auth = auth;
256256
return this;
@@ -266,7 +266,7 @@ public Builder<httpClientType, NativeRequestType> authenticationProvider(@Nonnul
266266
* if there was an exception creating the client
267267
*/
268268
@Nonnull
269-
protected <ClientType extends BaseClient<NativeRequestType>> ClientType buildClient(@Nonnull ClientType instance) throws ClientException {
269+
protected <ClientType extends BaseClient<nativeRequestType>> ClientType buildClient(@Nonnull ClientType instance) throws ClientException {
270270
Objects.requireNonNull(instance, "The instance cannot be null");
271271
instance.setHttpProvider(this.getHttpProvider());
272272
instance.setLogger(this.getLogger());
@@ -282,7 +282,7 @@ protected <ClientType extends BaseClient<NativeRequestType>> ClientType buildCli
282282
* if there was an exception creating the client
283283
*/
284284
@Nonnull
285-
public IBaseClient<NativeRequestType> buildClient() throws ClientException {
285+
public IBaseClient<nativeRequestType> buildClient() throws ClientException {
286286
return buildClient(new BaseClient<>());
287287
}
288288
}
@@ -302,7 +302,7 @@ protected static void checkNotNull(@Nullable final Object o, @Nonnull final Stri
302302
/**
303303
* The HTTP provider instance
304304
*/
305-
private IHttpProvider<NativeRequestType> httpProvider;
305+
private IHttpProvider<nativeRequestType> httpProvider;
306306

307307
/**
308308
* The logger
@@ -321,7 +321,7 @@ protected static void checkNotNull(@Nullable final Object o, @Nonnull final Stri
321321
*/
322322
@Override
323323
@Nullable
324-
public IHttpProvider<NativeRequestType> getHttpProvider() {
324+
public IHttpProvider<nativeRequestType> getHttpProvider() {
325325
return httpProvider;
326326
}
327327

@@ -361,7 +361,7 @@ protected void setLogger(@Nonnull final ILogger logger) {
361361
*
362362
* @param httpProvider The HTTP provider
363363
*/
364-
protected void setHttpProvider(@Nonnull final IHttpProvider<NativeRequestType> httpProvider) {
364+
protected void setHttpProvider(@Nonnull final IHttpProvider<nativeRequestType> httpProvider) {
365365
checkNotNull(httpProvider, "httpProvider");
366366
this.httpProvider = httpProvider;
367367
}

‎src/main/java/com/microsoft/graph/core/IBaseClient.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333

3434
/**
3535
* A client that communications with an OData service
36-
* @param <NativeRequestType> type of a request for the native http client
36+
* @param <nativeRequestType> type of a request for the native http client
3737
*/
38-
public interface IBaseClient<NativeRequestType> {
38+
public interface IBaseClient<nativeRequestType> {
3939
/**
4040
* Gets the service root
4141
*
@@ -57,7 +57,7 @@ public interface IBaseClient<NativeRequestType> {
5757
* @return the HTTP provider
5858
*/
5959
@Nullable
60-
IHttpProvider<NativeRequestType> getHttpProvider();
60+
IHttpProvider<nativeRequestType> getHttpProvider();
6161

6262
/**
6363
* Gets the logger

‎src/main/java/com/microsoft/graph/http/BaseCollectionRequest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,12 @@ public IHttpRequest withHttpMethod(@Nonnull final HttpMethod httpMethod) {
422422
* @param serializedObject the object to serialize at the body of the request
423423
* @param <requestBodyType> the type of the serialized object
424424
* @param <responseType> the type of the response
425-
* @param <NativeRequestType> type of a request for the native http client
425+
* @param <nativeRequestType> type of a request for the native http client
426426
* @return the Request object to be executed
427427
*/
428428
@Override
429429
@Nullable
430-
public <requestBodyType, responseType, NativeRequestType> NativeRequestType getHttpRequest(@Nonnull final requestBodyType serializedObject) throws ClientException {
430+
public <requestBodyType, responseType, nativeRequestType> nativeRequestType getHttpRequest(@Nonnull final requestBodyType serializedObject) throws ClientException {
431431
return baseRequest.getHttpRequest(serializedObject);
432432
}
433433
}

‎src/main/java/com/microsoft/graph/http/BaseRequest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,14 @@ public URL getRequestUrl() {
201201
* @param serializedObject the object to serialize at the body of the request
202202
* @param <requestBodyType> the type of the serialized object
203203
* @param <responseType> the type of the response
204-
* @param <NativeRequestType> type of a request for the native http client
204+
* @param <nativeRequestType> type of a request for the native http client
205205
* @return the Request object to be executed
206206
*/
207207
@Override
208208
@Nullable
209209
@SuppressWarnings("unchecked")
210-
public <requestBodyType, responseType, NativeRequestType> NativeRequestType getHttpRequest(@Nonnull final requestBodyType serializedObject) throws ClientException {
211-
return (NativeRequestType)client.getHttpProvider().getHttpRequest(this, (Class<responseType>) responseClass, serializedObject);
210+
public <requestBodyType, responseType, nativeRequestType> nativeRequestType getHttpRequest(@Nonnull final requestBodyType serializedObject) throws ClientException {
211+
return (nativeRequestType)client.getHttpProvider().getHttpRequest(this, (Class<responseType>) responseClass, serializedObject);
212212
}
213213

214214
private String addFunctionParameters() {

‎src/main/java/com/microsoft/graph/http/BaseStreamRequest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,12 @@ public IHttpRequest withHttpMethod(@Nonnull final HttpMethod httpMethod) {
296296
* @param serializedObject the object to serialize at the body of the request
297297
* @param <requestBodyType> the type of the serialized object
298298
* @param <responseType> the type of the response
299-
* @param <NativeRequestType> type of a request for the native http client
299+
* @param <nativeRequestType> type of a request for the native http client
300300
* @return the Request object to be executed
301301
*/
302302
@Override
303303
@Nullable
304-
public <requestBodyType, responseType, NativeRequestType> NativeRequestType getHttpRequest(@Nonnull final requestBodyType serializedObject) throws ClientException {
304+
public <requestBodyType, responseType, nativeRequestType> nativeRequestType getHttpRequest(@Nonnull final requestBodyType serializedObject) throws ClientException {
305305
return baseRequest.getHttpRequest(serializedObject);
306306
}
307307
}

‎src/main/java/com/microsoft/graph/http/IHttpProvider.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232
/**
3333
* Sends HTTP requests
34-
* @param <NativeRequestType> type of a request for the native http client
34+
* @param <nativeRequestType> type of a request for the native http client
3535
*/
36-
public interface IHttpProvider<NativeRequestType> {
36+
public interface IHttpProvider<nativeRequestType> {
3737

3838
/**
3939
* Get the serializer for this HTTP provider
@@ -127,7 +127,7 @@ <Result, BodyType, DeserializeType> Result send(@Nonnull final IHttpRequest requ
127127
* @throws ClientException an exception occurs if the request was unable to complete for any reason
128128
*/
129129
@Nullable
130-
<Result, BodyType> NativeRequestType getHttpRequest(@Nonnull final IHttpRequest request,
130+
<Result, BodyType> nativeRequestType getHttpRequest(@Nonnull final IHttpRequest request,
131131
@Nonnull final Class<Result> resultClass,
132132
@Nullable final BodyType serializable)
133133
throws ClientException;

‎src/main/java/com/microsoft/graph/http/IHttpRequest.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ public interface IHttpRequest {
176176

177177
/**
178178
* Returns the Request object to be executed
179-
* @param <NativeRequestType> type of a request for the native http client
179+
* @param <nativeRequestType> type of a request for the native http client
180180
* @return the Request object to be executed
181181
*/
182182
@Nullable
183-
default <NativeRequestType> NativeRequestType getHttpRequest() throws ClientException {
183+
default <nativeRequestType> nativeRequestType getHttpRequest() throws ClientException {
184184
return getHttpRequest(null); //TODO do something for the nonnull annotation
185185
}
186186

@@ -189,10 +189,10 @@ default <NativeRequestType> NativeRequestType getHttpRequest() throws ClientExce
189189
* @param serializedObject the object to serialize at the body of the request
190190
* @param <requestBodyType> the type of the serialized object
191191
* @param <responseType> the type of the response
192-
* @param <NativeRequestType> type of a request for the native http client
192+
* @param <nativeRequestType> type of a request for the native http client
193193
* @return the Request object to be executed
194194
*/
195195
@Nullable
196-
<requestBodyType, responseType, NativeRequestType> NativeRequestType getHttpRequest(@Nonnull final requestBodyType serializedObject) throws ClientException;
196+
<requestBodyType, responseType, nativeRequestType> nativeRequestType getHttpRequest(@Nonnull final requestBodyType serializedObject) throws ClientException;
197197
}
198198

0 commit comments

Comments
 (0)