rename 'fetchAssets' to 'listAssets' and return PagedIterable

This commit is contained in:
Tobias Nett
2020-11-18 19:27:31 +01:00
parent 98b067937a
commit 2676ef2b73
2 changed files with 6 additions and 7 deletions

View File

@@ -272,12 +272,12 @@ public class GHRelease extends GHObject {
* @throws IOException
* the io exception
* @deprecated The behavior of this method will change in a future release. It will then provide cached assets as
* provided by {@link #getCachedAssets()}. Use {@link #fetchAssets()} instead to fetch up-to-date
* provided by {@link #getCachedAssets()}. Use {@link #listAssets()} instead to fetch up-to-date
* information of assets.
*/
@Deprecated
public List<GHAsset> getAssets() throws IOException {
return fetchAssets();
return listAssets().toList();
}
/**
@@ -287,11 +287,10 @@ public class GHRelease extends GHObject {
* @throws IOException
* the io exception
*/
public List<GHAsset> fetchAssets() throws IOException {
public PagedIterable<GHAsset> listAssets() throws IOException {
Requester builder = owner.root.createRequest();
return builder.withUrlPath(getApiTailUrl("assets"))
.toIterable(GHAsset[].class, item -> item.wrap(this))
.toList();
.toIterable(GHAsset[].class, item -> item.wrap(this));
}
/**