2323package com .microsoft .graph .content ;
2424
2525import java .util .ArrayList ;
26+ import java .util .Arrays ;
2627import java .util .HashMap ;
2728import java .util .HashSet ;
2829import java .util .List ;
@@ -77,7 +78,7 @@ public String addBatchRequestStep(@Nonnull final IHttpRequest request, @Nonnull
7778 */
7879 @ Nonnull
7980 public <T > String addBatchRequestStep (@ Nonnull final IHttpRequest request , @ Nonnull final HttpMethod httpMethod , @ Nullable final T serializableBody ) {
80- return addBatchRequestStep (request , httpMethod , serializableBody , null );
81+ return addBatchRequestStep (request , httpMethod , serializableBody , ( String []) null );
8182 }
8283 /**
8384 * Adds a request as a step to the current batch
@@ -88,7 +89,7 @@ public <T> String addBatchRequestStep(@Nonnull final IHttpRequest request, @Nonn
8889 * @param dependsOnRequestsIds the ids of steps this request depends on
8990 * @return the id of the step that was just added to the batch
9091 */
91- public <T > String addBatchRequestStep (@ Nonnull final IHttpRequest request , @ Nonnull final HttpMethod httpMethod , @ Nullable final T serializableBody , @ Nullable final HashSet < String > dependsOnRequestsIds ) {
92+ public <T > String addBatchRequestStep (@ Nonnull final IHttpRequest request , @ Nonnull final HttpMethod httpMethod , @ Nullable final T serializableBody , @ Nullable final String ... dependsOnRequestsIds ) {
9293 Objects .requireNonNull (request , "request parameter cannot be null" );
9394 Objects .requireNonNull (httpMethod , "httpMethod parameter cannot be null" );
9495 if (dependsOnRequestsIds != null )
@@ -105,7 +106,7 @@ public <T> String addBatchRequestStep(@Nonnull final IHttpRequest request, @Nonn
105106 url = protocolAndHostReplacementMatcher .replaceAll ("" );
106107 body = serializableBody ;
107108 method = httpMethod ;
108- dependsOn = dependsOnRequestsIds ;
109+ dependsOn = dependsOnRequestsIds != null && dependsOnRequestsIds . length > 0 ? new HashSet < String >( Arrays . asList ( dependsOnRequestsIds )) : null ;
109110 id = getNextRequestId ();
110111 }};
111112
0 commit comments