Interface Topics.FetchResult<V>

Type Parameters:
V - The result value type. This would be Void unless the request indicated that values 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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Encapsulates the result of a fetch invocation for a single selected topic.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether the fetch could have returned more results if it had not been constrained by the first, last or maximumResultSize limits.
    boolean
    Returns true if the result contains zero elements.
    Returns the results from the fetch operation.
    int
    The number of elements in the fetch result.
  • Method Details

    • 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 the first, last or maximumResultSize 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 to Topics.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()
      Returns true if the result contains zero elements.
      Returns:
      true if result list is empty
      Since:
      6.3