Skip to content

Commit 6d3e786

Browse files
committed
- fixes a bug where references collections would return the wrong type
1 parent 0e48ed0 commit 6d3e786

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Templates/Java/requests_extensions/BaseEntityCollectionWithReferencesRequest.java.tt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,44 @@ import <#=importNamespace#>.concurrency.IExecutors;
4545
}
4646

4747
<# if (c.GetFeatures().CanExpand) { #>
48-
public <#=c.ITypeCollectionRequest()#> expand(final String value) {
48+
public <#=c.ITypeCollectionWithReferencesRequest()#> expand(final String value) {
4949
addQueryOption(new com.microsoft.graph.options.QueryOption("$expand", value));
50-
return (<#=c.TypeCollectionRequest()#>)this;
50+
return this;
5151
}
5252

5353
<# } #>
5454
<# if (c.GetFeatures().CanFilter) { #>
55-
public <#=c.ITypeCollectionRequest()#> filter(final String value) {
55+
public <#=c.ITypeCollectionWithReferencesRequest()#> filter(final String value) {
5656
addQueryOption(new com.microsoft.graph.options.QueryOption("$filter", value));
57-
return (<#=c.TypeCollectionRequest()#>)this;
57+
return this;
5858
}
5959

6060
<# } #>
6161
<# if (c.GetFeatures().CanSort) { #>
62-
public <#=c.ITypeCollectionRequest()#> orderBy(final String value) {
62+
public <#=c.ITypeCollectionWithReferencesRequest()#> orderBy(final String value) {
6363
addQueryOption(new com.microsoft.graph.options.QueryOption("$orderby", value));
64-
return (<#=c.TypeCollectionRequest()#>)this;
64+
return this;
6565
}
6666

6767
<# } #>
6868
<# if (c.GetFeatures().CanSelect) { #>
69-
public <#=c.ITypeCollectionRequest()#> select(final String value) {
69+
public <#=c.ITypeCollectionWithReferencesRequest()#> select(final String value) {
7070
addQueryOption(new com.microsoft.graph.options.QueryOption("$select", value));
71-
return (<#=c.TypeCollectionRequest()#>)this;
71+
return this;
7272
}
7373

7474
<# } #>
7575
<# if (c.GetFeatures().CanUseTop) { #>
76-
public <#=c.ITypeCollectionRequest()#> top(final int value) {
76+
public <#=c.ITypeCollectionWithReferencesRequest()#> top(final int value) {
7777
addQueryOption(new com.microsoft.graph.options.QueryOption("$top", value + ""));
78-
return (<#=c.TypeCollectionRequest()#>)this;
78+
return this;
7979
}
8080

8181
<# } #>
8282
public <#=c.ITypeCollectionWithReferencesPage()#> buildFromResponse(final <#=c.TypeCollectionResponse()#> response) {
83-
final <#=c.ITypeCollectionRequestBuilder()#> builder;
83+
final <#=c.ITypeCollectionWithReferencesRequestBuilder()#> builder;
8484
if (response.nextLink != null) {
85-
builder = new <#=c.TypeCollectionRequestBuilder()#>(response.nextLink, getBaseRequest().getClient(), /* options */ null);
85+
builder = new <#=c.TypeCollectionWithReferencesRequestBuilder()#>(response.nextLink, getBaseRequest().getClient(), /* options */ null);
8686
} else {
8787
builder = null;
8888
}

0 commit comments

Comments
 (0)