All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.serialized.client.feed.FeedResponse Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
package io.serialized.client.feed;

import java.util.List;
import java.util.stream.Collectors;

import static java.util.Collections.unmodifiableList;

public class FeedResponse {

  private List entries;
  private boolean hasMore;
  private long currentSequenceNumber;

  /**
   * @return List of all events from all batches.
   */
  public List events() {
    return unmodifiableList(entries.stream().flatMap(e -> e.events().stream()).collect(Collectors.toList()));
  }

  /**
   * @return The entries.
   */
  public List entries() {
    return unmodifiableList(entries);
  }

  /**
   * @return True if there are more events available in the feed.
   */
  public boolean hasMore() {
    return hasMore;
  }

  /**
   * @return Current sequence number at feed head.
   */
  public long currentSequenceNumber() {
    return currentSequenceNumber;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy