Interface Topics.FetchResult<V>
- Type Parameters:
V- The result value type. This would be Void unless the request indicated thatvaluesare 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 interfaceEncapsulates the result of afetchinvocation for a single selected topic. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasMore()Indicates whether the fetch could have returned more results if it had not been constrained by thefirst,lastormaximumResultSizelimits.booleanisEmpty()Returnstrueif the result contains zero elements.results()Returns the results from the fetch operation.intsize()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,lastormaximumResultSizelimits. 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()Returnstrueif the result contains zero elements.- Returns:
- true if result list is empty
- Since:
- 6.3
-