com.atlassian.jira.sharing.search
Class SharedEntitySearchResult

java.lang.Object
  extended by com.atlassian.jira.sharing.search.SharedEntitySearchResult
All Implemented Interfaces:
CloseableIterable, Sized

public class SharedEntitySearchResult
extends Object
implements CloseableIterable

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.util.collect.CloseableIterable
CloseableIterable.ListResolver
 
Constructor Summary
SharedEntitySearchResult(CloseableIterable results, boolean hasNext, int totalResultCount)
           
 
Method Summary
 List getResults()
          Prefer the iterator() method if the result size is large as it doesn't load everything into memory.
 int getTotalResultCount()
           
 boolean hasMoreResults()
           
 boolean isEmpty()
           
 CloseableIterator iterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedEntitySearchResult

public SharedEntitySearchResult(CloseableIterable results,
                                boolean hasNext,
                                int totalResultCount)
Method Detail

getResults

public List getResults()
Prefer the iterator() 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()

size

public int size()
Specified by:
size in interface CloseableIterable
Specified by:
size in interface Sized
Returns:
the likely size of the objects returned by the CloseableIterable.iterator(). Be careful depending on this size being exact, as in many cases its best efforts value or may be stable due to concurrent changes.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface CloseableIterable
Returns:
true if the there is no data behind it. In this case the CloseableIterable.iterator().hasNext() will return false;

iterator

public CloseableIterator iterator()
Specified by:
iterator in interface CloseableIterable
Returns:
a CloseableIterator that can be closed once finished with


Copyright © 2002-2009 Atlassian. All Rights Reserved.