Class SharedEntitySearchResult<E extends SharedEntity>

java.lang.Object
com.atlassian.jira.sharing.search.SharedEntitySearchResult<E>
All Implemented Interfaces:
EnclosedIterable<E>, Sized

@PublicApi public class SharedEntitySearchResult<E extends SharedEntity> extends Object implements EnclosedIterable<E>
A pair that contains the result status of SharedEntity search. It contains the actual results and a boolean value that indicates whether or not more results are still available. It also contains the total number of results found, which may be greater than the original page size requested.
Since:
v3.13
  • Constructor Details

    • SharedEntitySearchResult

      public SharedEntitySearchResult(EnclosedIterable<E> results, boolean hasNext, int totalResultCount)
  • Method Details

    • getResults

      public List<E> getResults()
      Prefer the foreach(Consumer) method if the result size is large as it doesn't load everything into memory.
      Returns:
      a list of results
    • hasMoreResults

      public boolean hasMoreResults()
    • getTotalResultCount

      public int getTotalResultCount()
      Returns:
      the total number of results found in a search. This will always be >= size()
    • foreach

      public final void foreach(Consumer<E> sink)
      Description copied from interface: EnclosedIterable
      Apply the sink to all elements in the Collection.
      Specified by:
      foreach in interface EnclosedIterable<E extends SharedEntity>
    • size

      public int size()
      Specified by:
      size in interface EnclosedIterable<E extends SharedEntity>
      Specified by:
      size in interface Sized
      Returns:
      the likely size of the objects passed into the sink in EnclosedIterable.foreach(Consumer). Be careful depending on this size being exact, as in many cases its best efforts value or may be unstable due to concurrent changes.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface EnclosedIterable<E extends SharedEntity>
      Specified by:
      isEmpty in interface Sized
      Returns:
      true if the there is no data behind it.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object