77import io .getstream .core .models .FeedID ;
88import io .getstream .core .models .FollowRelation ;
99import io .getstream .core .options .CustomQueryParameter ;
10- import io .getstream .core .options .Pagination ;
10+ import io .getstream .core .options .Limit ;
11+ import io .getstream .core .options .Offset ;
1112import io .getstream .core .options .RequestOption ;
1213import io .getstream .core .utils .DefaultOptions ;
1314
@@ -86,7 +87,7 @@ public final <T> CompletableFuture<List<T>> addCustomActivities(Iterable<T> acti
8687 .addActivities (id , custom )
8788 .thenApply (response -> {
8889 try {
89- Class <T > element = (Class <T >) ((ParameterizedType ) getClass ().getGenericSuperclass ()) .getActualTypeArguments ()[0 ];
90+ Class <T > element = (Class <T >) ((ParameterizedType ) getClass ().getGenericSuperclass ()).getActualTypeArguments ()[0 ];
9091 return deserializeContainer (response , "activities" , element );
9192 } catch (StreamException | IOException e ) {
9293 throw new CompletionException (e );
@@ -165,26 +166,42 @@ public final CompletableFuture<Void> follow(FlatFeed feed, int activityCopyLimit
165166 }
166167
167168 public final CompletableFuture <List <FollowRelation >> getFollowers (Iterable <FeedID > feedIDs ) throws StreamException {
168- return getFollowers (DefaultOptions .DEFAULT_PAGINATION , Iterables .toArray (feedIDs , FeedID .class ));
169+ return getFollowers (DefaultOptions .DEFAULT_LIMIT , DefaultOptions . DEFAULT_OFFSET , Iterables .toArray (feedIDs , FeedID .class ));
169170 }
170171
171172 public final CompletableFuture <List <FollowRelation >> getFollowers (FeedID ... feedIDs ) throws StreamException {
172- return getFollowers (DefaultOptions .DEFAULT_PAGINATION , feedIDs );
173+ return getFollowers (DefaultOptions .DEFAULT_LIMIT , DefaultOptions . DEFAULT_OFFSET , feedIDs );
173174 }
174175
175- public final CompletableFuture <List <FollowRelation >> getFollowers (Pagination pagination , Iterable <FeedID > feedIDs ) throws StreamException {
176- return getFollowers (pagination , Iterables .toArray (feedIDs , FeedID .class ));
176+ public final CompletableFuture <List <FollowRelation >> getFollowers (Limit limit , Iterable <FeedID > feedIDs ) throws StreamException {
177+ return getFollowers (limit , DefaultOptions . DEFAULT_OFFSET , Iterables .toArray (feedIDs , FeedID .class ));
177178 }
178179
179- public final CompletableFuture <List <FollowRelation >> getFollowers (Pagination pagination , FeedID ... feeds ) throws StreamException {
180+ public final CompletableFuture <List <FollowRelation >> getFollowers (Limit limit , FeedID ... feedIDs ) throws StreamException {
181+ return getFollowers (limit , DefaultOptions .DEFAULT_OFFSET , feedIDs );
182+ }
183+
184+ public final CompletableFuture <List <FollowRelation >> getFollowers (Offset offset , Iterable <FeedID > feedIDs ) throws StreamException {
185+ return getFollowers (DefaultOptions .DEFAULT_LIMIT , offset , Iterables .toArray (feedIDs , FeedID .class ));
186+ }
187+
188+ public final CompletableFuture <List <FollowRelation >> getFollowers (Offset offset , FeedID ... feedIDs ) throws StreamException {
189+ return getFollowers (DefaultOptions .DEFAULT_LIMIT , offset , feedIDs );
190+ }
191+
192+ public final CompletableFuture <List <FollowRelation >> getFollowers (Limit limit , Offset offset , Iterable <FeedID > feedIDs ) throws StreamException {
193+ return getFollowers (limit , offset , Iterables .toArray (feedIDs , FeedID .class ));
194+ }
195+
196+ public final CompletableFuture <List <FollowRelation >> getFollowers (Limit limit , Offset offset , FeedID ... feeds ) throws StreamException {
180197 checkNotNull (feeds , "No feed ids to filter on" );
181198
182199 final String [] feedIDs = Arrays .stream (feeds )
183200 .map (id -> id .toString ())
184201 .toArray (String []::new );
185202 final RequestOption [] options = feedIDs .length == 0
186- ? new RequestOption [] { pagination }
187- : new RequestOption [] { pagination , new CustomQueryParameter ("filter" , String .join ("," , feedIDs )) };
203+ ? new RequestOption []{ limit , offset }
204+ : new RequestOption []{ limit , offset , new CustomQueryParameter ("filter" , String .join ("," , feedIDs ))};
188205 return client
189206 .getFollowers (id , options )
190207 .thenApply (response -> {
@@ -197,26 +214,42 @@ public final CompletableFuture<List<FollowRelation>> getFollowers(Pagination pag
197214 }
198215
199216 public final CompletableFuture <List <FollowRelation >> getFollowed (Iterable <FeedID > feedIDs ) throws StreamException {
200- return getFollowed (DefaultOptions .DEFAULT_PAGINATION , Iterables .toArray (feedIDs , FeedID .class ));
217+ return getFollowed (DefaultOptions .DEFAULT_LIMIT , DefaultOptions . DEFAULT_OFFSET , Iterables .toArray (feedIDs , FeedID .class ));
201218 }
202219
203220 public final CompletableFuture <List <FollowRelation >> getFollowed (FeedID ... feedIDs ) throws StreamException {
204- return getFollowed (DefaultOptions .DEFAULT_PAGINATION , feedIDs );
221+ return getFollowed (DefaultOptions .DEFAULT_LIMIT , DefaultOptions .DEFAULT_OFFSET , feedIDs );
222+ }
223+
224+ public final CompletableFuture <List <FollowRelation >> getFollowed (Offset offset , Iterable <FeedID > feedIDs ) throws StreamException {
225+ return getFollowed (DefaultOptions .DEFAULT_LIMIT , offset , Iterables .toArray (feedIDs , FeedID .class ));
226+ }
227+
228+ public final CompletableFuture <List <FollowRelation >> getFollowed (Offset offset , FeedID ... feedIDs ) throws StreamException {
229+ return getFollowed (DefaultOptions .DEFAULT_LIMIT , offset , feedIDs );
230+ }
231+
232+ public final CompletableFuture <List <FollowRelation >> getFollowed (Limit limit , Iterable <FeedID > feedIDs ) throws StreamException {
233+ return getFollowed (limit , DefaultOptions .DEFAULT_OFFSET , Iterables .toArray (feedIDs , FeedID .class ));
234+ }
235+
236+ public final CompletableFuture <List <FollowRelation >> getFollowed (Limit limit , FeedID ... feedIDs ) throws StreamException {
237+ return getFollowed (limit , DefaultOptions .DEFAULT_OFFSET , feedIDs );
205238 }
206239
207- public final CompletableFuture <List <FollowRelation >> getFollowed (Pagination pagination , Iterable <FeedID > feedIDs ) throws StreamException {
208- return getFollowed (pagination , Iterables .toArray (feedIDs , FeedID .class ));
240+ public final CompletableFuture <List <FollowRelation >> getFollowed (Limit limit , Offset offset , Iterable <FeedID > feedIDs ) throws StreamException {
241+ return getFollowed (limit , offset , Iterables .toArray (feedIDs , FeedID .class ));
209242 }
210243
211- public final CompletableFuture <List <FollowRelation >> getFollowed (Pagination pagination , FeedID ... feeds ) throws StreamException {
244+ public final CompletableFuture <List <FollowRelation >> getFollowed (Limit limit , Offset offset , FeedID ... feeds ) throws StreamException {
212245 checkNotNull (feeds , "No feed ids to filter on" );
213246
214247 final String [] feedIDs = Arrays .stream (feeds )
215248 .map (id -> id .toString ())
216249 .toArray (String []::new );
217250 final RequestOption [] options = feedIDs .length == 0
218- ? new RequestOption [] { pagination }
219- : new RequestOption [] { pagination , new CustomQueryParameter ("filter" , String .join ("," , feedIDs )) };
251+ ? new RequestOption []{ limit , offset }
252+ : new RequestOption []{ limit , offset , new CustomQueryParameter ("filter" , String .join ("," , feedIDs ))};
220253 return client
221254 .getFollowed (id , options )
222255 .thenApply (response -> {
0 commit comments