io.getstream.client.FlatFeed Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stream-java Show documentation
Show all versions of stream-java Show documentation
Stream Feeds Java Client for backend and android integrations
package io.getstream.client;
import static io.getstream.core.utils.Serialization.deserializeContainer;
import io.getstream.core.exceptions.StreamException;
import io.getstream.core.models.Activity;
import io.getstream.core.models.EnrichedActivity;
import io.getstream.core.models.FeedID;
import io.getstream.core.options.*;
import io.getstream.core.utils.DefaultOptions;
import java.io.IOException;
import java.util.List;
import java8.util.concurrent.CompletableFuture;
import java8.util.concurrent.CompletionException;
public final class FlatFeed extends Feed {
FlatFeed(Client client, FeedID id) {
super(client, id);
}
public CompletableFuture> getActivities() throws StreamException {
return getActivities(
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
null);
}
public CompletableFuture> getActivities(Limit limit) throws StreamException {
return getActivities(limit, DefaultOptions.DEFAULT_OFFSET, DefaultOptions.DEFAULT_FILTER, null);
}
public CompletableFuture> getActivities(String ranking) throws StreamException {
return getActivities(
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
ranking);
}
public CompletableFuture> getActivities(Filter filter) throws StreamException {
return getActivities(DefaultOptions.DEFAULT_LIMIT, DefaultOptions.DEFAULT_OFFSET, filter, null);
}
public CompletableFuture> getActivities(Offset offset) throws StreamException {
return getActivities(DefaultOptions.DEFAULT_LIMIT, offset, DefaultOptions.DEFAULT_FILTER, null);
}
public CompletableFuture> getActivities(Limit limit, String ranking)
throws StreamException {
return getActivities(
limit, DefaultOptions.DEFAULT_OFFSET, DefaultOptions.DEFAULT_FILTER, ranking);
}
public CompletableFuture> getActivities(Limit limit, Filter filter)
throws StreamException {
return getActivities(limit, DefaultOptions.DEFAULT_OFFSET, filter, null);
}
public CompletableFuture> getActivities(Limit limit, Offset offset)
throws StreamException {
return getActivities(limit, offset, DefaultOptions.DEFAULT_FILTER, null);
}
public CompletableFuture> getActivities(Filter filter, String ranking)
throws StreamException {
return getActivities(
DefaultOptions.DEFAULT_LIMIT, DefaultOptions.DEFAULT_OFFSET, filter, ranking);
}
public CompletableFuture> getActivities(Offset offset, String ranking)
throws StreamException {
return getActivities(
DefaultOptions.DEFAULT_LIMIT, offset, DefaultOptions.DEFAULT_FILTER, ranking);
}
public CompletableFuture> getActivities(Limit limit, Filter filter, String ranking)
throws StreamException {
return getActivities(limit, DefaultOptions.DEFAULT_OFFSET, filter, ranking);
}
public CompletableFuture> getActivities(Limit limit, Offset offset, String ranking)
throws StreamException {
return getActivities(limit, offset, DefaultOptions.DEFAULT_FILTER, ranking);
}
CompletableFuture> getActivities(
Limit limit, Offset offset, Filter filter, String ranking) throws StreamException {
final RequestOption[] options =
ranking == null
? new RequestOption[] {limit, offset, filter, DefaultOptions.DEFAULT_MARKER}
: new RequestOption[] {
limit, offset, filter, DefaultOptions.DEFAULT_MARKER, new Ranking(ranking)
};
return getClient()
.getActivities(getID(), options)
.thenApply(
response -> {
try {
return deserializeContainer(response, Activity.class);
} catch (StreamException | IOException e) {
throw new CompletionException(e);
}
});
}
CompletableFuture> getActivities(
Limit limit, Offset offset, Filter filter, String ranking, RankingVars rankingVars) throws StreamException {
final RequestOption[] options =
ranking == null
? new RequestOption[] {limit, offset, filter, DefaultOptions.DEFAULT_MARKER}
: new RequestOption[] {
limit, offset, filter, DefaultOptions.DEFAULT_MARKER, new Ranking(ranking), rankingVars
};
return getClient()
.getActivities(getID(), options)
.thenApply(
response -> {
try {
return deserializeContainer(response, Activity.class);
} catch (StreamException | IOException e) {
throw new CompletionException(e);
}
});
}
public CompletableFuture> getCustomActivities(Class type) throws StreamException {
return getCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
null);
}
public CompletableFuture> getCustomActivities(Class type, Limit limit)
throws StreamException {
return getCustomActivities(
type, limit, DefaultOptions.DEFAULT_OFFSET, DefaultOptions.DEFAULT_FILTER, null);
}
public CompletableFuture> getCustomActivities(Class type, String ranking)
throws StreamException {
return getCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
ranking);
}
public CompletableFuture> getCustomActivities(Class type, Filter filter)
throws StreamException {
return getCustomActivities(
type, DefaultOptions.DEFAULT_LIMIT, DefaultOptions.DEFAULT_OFFSET, filter, null);
}
public CompletableFuture> getCustomActivities(Class type, Offset offset)
throws StreamException {
return getCustomActivities(
type, DefaultOptions.DEFAULT_LIMIT, offset, DefaultOptions.DEFAULT_FILTER, null);
}
public CompletableFuture> getCustomActivities(
Class type, Limit limit, String ranking) throws StreamException {
return getCustomActivities(
type, limit, DefaultOptions.DEFAULT_OFFSET, DefaultOptions.DEFAULT_FILTER, ranking);
}
public CompletableFuture> getCustomActivities(
Class type, Limit limit, Filter filter) throws StreamException {
return getCustomActivities(type, limit, DefaultOptions.DEFAULT_OFFSET, filter, null);
}
public CompletableFuture> getCustomActivities(
Class type, Limit limit, Offset offset) throws StreamException {
return getCustomActivities(type, limit, offset, DefaultOptions.DEFAULT_FILTER, null);
}
public CompletableFuture> getCustomActivities(
Class type, Offset offset, String ranking) throws StreamException {
return getCustomActivities(
type, DefaultOptions.DEFAULT_LIMIT, offset, DefaultOptions.DEFAULT_FILTER, ranking);
}
public CompletableFuture> getCustomActivities(
Class type, Filter filter, String ranking) throws StreamException {
return getCustomActivities(
type, DefaultOptions.DEFAULT_LIMIT, DefaultOptions.DEFAULT_OFFSET, filter, ranking);
}
public CompletableFuture> getCustomActivities(
Class type, Limit limit, Offset offset, String ranking) throws StreamException {
return getCustomActivities(type, limit, offset, DefaultOptions.DEFAULT_FILTER, ranking);
}
public CompletableFuture> getCustomActivities(
Class type, Limit limit, Filter filter, String ranking) throws StreamException {
return getCustomActivities(type, limit, DefaultOptions.DEFAULT_OFFSET, filter, ranking);
}
CompletableFuture> getCustomActivities(
Class type, Limit limit, Offset offset, Filter filter, String ranking)
throws StreamException {
final RequestOption[] options =
ranking == null
? new RequestOption[] {limit, offset, filter, DefaultOptions.DEFAULT_MARKER}
: new RequestOption[] {
limit, offset, filter, DefaultOptions.DEFAULT_MARKER, new Ranking(ranking)
};
return getClient()
.getActivities(getID(), options)
.thenApply(
response -> {
try {
return deserializeContainer(response, type);
} catch (StreamException | IOException e) {
throw new CompletionException(e);
}
});
}
public CompletableFuture> getEnrichedActivities() throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedActivities(Limit limit)
throws StreamException {
return getEnrichedActivities(
limit,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedActivities(EnrichmentFlags flags)
throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
flags,
null);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, EnrichmentFlags flags) throws StreamException {
return getEnrichedActivities(
limit, DefaultOptions.DEFAULT_OFFSET, DefaultOptions.DEFAULT_FILTER, flags, null);
}
public CompletableFuture> getEnrichedActivities(String ranking)
throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, String ranking) throws StreamException {
return getEnrichedActivities(
limit,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedActivities(
EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
flags,
ranking);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedActivities(
limit, DefaultOptions.DEFAULT_OFFSET, DefaultOptions.DEFAULT_FILTER, flags, ranking);
}
public CompletableFuture> getEnrichedActivities(Filter filter)
throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
filter,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedActivities(Limit limit, Filter filter)
throws StreamException {
return getEnrichedActivities(
limit,
DefaultOptions.DEFAULT_OFFSET,
filter,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedActivities(
Filter filter, EnrichmentFlags flags) throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT, DefaultOptions.DEFAULT_OFFSET, filter, flags, null);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, Filter filter, EnrichmentFlags flags) throws StreamException {
return getEnrichedActivities(limit, DefaultOptions.DEFAULT_OFFSET, filter, flags, null);
}
public CompletableFuture> getEnrichedActivities(Offset offset)
throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT,
offset,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedActivities(Limit limit, Offset offset)
throws StreamException {
return getEnrichedActivities(
limit,
offset,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedActivities(
Offset offset, EnrichmentFlags flags) throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT, offset, DefaultOptions.DEFAULT_FILTER, flags, null);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, Offset offset, EnrichmentFlags flags) throws StreamException {
return getEnrichedActivities(limit, offset, DefaultOptions.DEFAULT_FILTER, flags, null);
}
public CompletableFuture> getEnrichedActivities(
Filter filter, String ranking) throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
filter,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, Filter filter, String ranking) throws StreamException {
return getEnrichedActivities(
limit,
DefaultOptions.DEFAULT_OFFSET,
filter,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedActivities(
Filter filter, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT, DefaultOptions.DEFAULT_OFFSET, filter, flags, ranking);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, Filter filter, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedActivities(limit, DefaultOptions.DEFAULT_OFFSET, filter, flags, ranking);
}
public CompletableFuture> getEnrichedActivities(
Offset offset, String ranking) throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT,
offset,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, Offset offset, String ranking) throws StreamException {
return getEnrichedActivities(
limit,
offset,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedActivities(
Offset offset, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedActivities(
DefaultOptions.DEFAULT_LIMIT, offset, DefaultOptions.DEFAULT_FILTER, flags, ranking);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, Offset offset, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedActivities(limit, offset, DefaultOptions.DEFAULT_FILTER, flags, ranking);
}
public CompletableFuture> getEnrichedActivities(
Limit limit, Offset offset, Filter filter, EnrichmentFlags flags, String ranking)
throws StreamException {
final RequestOption[] options =
ranking == null
? new RequestOption[] {limit, offset, filter, flags, DefaultOptions.DEFAULT_MARKER}
: new RequestOption[] {
limit, offset, filter, flags, DefaultOptions.DEFAULT_MARKER, new Ranking(ranking)
};
return getClient()
.getEnrichedActivities(getID(), options)
.thenApply(
response -> {
try {
return deserializeContainer(response, EnrichedActivity.class);
} catch (StreamException | IOException e) {
throw new CompletionException(e);
}
});
}
public CompletableFuture> getEnrichedCustomActivities(Class type)
throws StreamException {
return getEnrichedCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedCustomActivities(Class type, Limit limit)
throws StreamException {
return getEnrichedCustomActivities(
type,
limit,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, EnrichmentFlags flags) throws StreamException {
return getEnrichedCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
flags,
null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, EnrichmentFlags flags) throws StreamException {
return getEnrichedCustomActivities(
type, limit, DefaultOptions.DEFAULT_OFFSET, DefaultOptions.DEFAULT_FILTER, flags, null);
}
public CompletableFuture> getEnrichedCustomActivities(Class type, String ranking)
throws StreamException {
return getEnrichedCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type,
limit,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
DefaultOptions.DEFAULT_FILTER,
flags,
ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type, limit, DefaultOptions.DEFAULT_OFFSET, DefaultOptions.DEFAULT_FILTER, flags, ranking);
}
public CompletableFuture> getEnrichedCustomActivities(Class type, Filter filter)
throws StreamException {
return getEnrichedCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
filter,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, Filter filter) throws StreamException {
return getEnrichedCustomActivities(
type,
limit,
DefaultOptions.DEFAULT_OFFSET,
filter,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Filter filter, EnrichmentFlags flags) throws StreamException {
return getEnrichedCustomActivities(
type, DefaultOptions.DEFAULT_LIMIT, DefaultOptions.DEFAULT_OFFSET, filter, flags, null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, Filter filter, EnrichmentFlags flags) throws StreamException {
return getEnrichedCustomActivities(
type, limit, DefaultOptions.DEFAULT_OFFSET, filter, flags, null);
}
public CompletableFuture> getEnrichedCustomActivities(Class type, Offset offset)
throws StreamException {
return getEnrichedCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
offset,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, Offset offset) throws StreamException {
return getEnrichedCustomActivities(
type,
limit,
offset,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Offset offset, EnrichmentFlags flags) throws StreamException {
return getEnrichedCustomActivities(
type, DefaultOptions.DEFAULT_LIMIT, offset, DefaultOptions.DEFAULT_FILTER, flags, null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, Offset offset, EnrichmentFlags flags) throws StreamException {
return getEnrichedCustomActivities(
type, limit, offset, DefaultOptions.DEFAULT_FILTER, flags, null);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Offset offset, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
offset,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, Offset offset, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type,
limit,
offset,
DefaultOptions.DEFAULT_FILTER,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Offset offset, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type, DefaultOptions.DEFAULT_LIMIT, offset, DefaultOptions.DEFAULT_FILTER, flags, ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, Offset offset, EnrichmentFlags flags, String ranking)
throws StreamException {
return getEnrichedCustomActivities(
type, limit, offset, DefaultOptions.DEFAULT_FILTER, flags, ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Filter filter, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type,
DefaultOptions.DEFAULT_LIMIT,
DefaultOptions.DEFAULT_OFFSET,
filter,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, Filter filter, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type,
limit,
DefaultOptions.DEFAULT_OFFSET,
filter,
DefaultOptions.DEFAULT_ENRICHMENT_FLAGS,
ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Filter filter, EnrichmentFlags flags, String ranking) throws StreamException {
return getEnrichedCustomActivities(
type, DefaultOptions.DEFAULT_LIMIT, DefaultOptions.DEFAULT_OFFSET, filter, flags, ranking);
}
public CompletableFuture> getEnrichedCustomActivities(
Class type, Limit limit, Filter filter, EnrichmentFlags flags, String ranking)
throws StreamException {
return getEnrichedCustomActivities(
type, limit, DefaultOptions.DEFAULT_OFFSET, filter, flags, ranking);
}
CompletableFuture> getEnrichedCustomActivities(
Class type,
Limit limit,
Offset offset,
Filter filter,
EnrichmentFlags flags,
String ranking)
throws StreamException {
final RequestOption[] options =
ranking == null
? new RequestOption[] {limit, offset, filter, flags, DefaultOptions.DEFAULT_MARKER}
: new RequestOption[] {
limit, offset, filter, flags, DefaultOptions.DEFAULT_MARKER, new Ranking(ranking)
};
return getClient()
.getActivities(getID(), options)
.thenApply(
response -> {
try {
return deserializeContainer(response, type);
} catch (StreamException | IOException e) {
throw new CompletionException(e);
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy