Interface Topics.FetchResult<V>
- Type Parameters:
V
- The result value type. This would be Void unless the request indicated thatvalues
are to be returned, in which case this would be the value class requested.
- Enclosing interface:
- Topics
public static interface Topics.FetchResult<V>
Encapsulates the results from a fetch operation issued to the server.
A fetch operation is issued using a fetch request
which will return a result of this type via a CompletableFuture
.
- Since:
- 6.2
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Encapsulates the result of afetch
invocation for a single selected topic. -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasMore()
Indicates whether the fetch could have returned more results if it had not been constrained by thefirst
,last
ormaximumResultSize
limits.boolean
isEmpty()
Returnstrue
if the result contains zero elements.results()
Returns the results from the fetch operation.int
size()
The number of elements in the fetch result.
-
Method Details
-
results
List<Topics.FetchResult.TopicResult<V>> results()Returns the results from the fetch operation.Results are always returned in path order.
- Returns:
- a list of topic results, each representing a result single topic selected by the fetch operation.
-
hasMore
boolean hasMore()Indicates whether the fetch could have returned more results if it had not been constrained by thefirst
,last
ormaximumResultSize
limits. A fetch that requests no results can be used together with this method to query whether there are topics that match the selector provided toTopics.FetchRequest.fetch(com.pushtechnology.diffusion.client.topics.TopicSelector)
, without retrieving the details of any of the topics. For example:topics.fetchRequest().first(0).fetch("?x//").thenAccept(fetchResult -> { if (fetchResult.hasMore()) { System.out.println("There are topics in branch 'x'."); } }
- Returns:
- true if more results could have been returned, otherwise false
-
size
int size()The number of elements in the fetch result.- Returns:
- the size of the results list
- Since:
- 6.3
-
isEmpty
boolean isEmpty()Returnstrue
if the result contains zero elements.- Returns:
- true if result list is empty
- Since:
- 6.3
-