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
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.util.collect.EnclosedIterable
EnclosedIterable.Functions, EnclosedIterable.ListResolver<T>
-
Constructor Summary
ConstructorsConstructorDescriptionSharedEntitySearchResult
(EnclosedIterable<E> results, boolean hasNext, int totalResultCount) -
Method Summary
Modifier and TypeMethodDescriptionboolean
final void
Apply the sink to all elements in the Collection.Prefer theforeach(Consumer)
method if the result size is large as it doesn't load everything into memory.int
int
hashCode()
boolean
boolean
isEmpty()
int
size()
-
Constructor Details
-
SharedEntitySearchResult
-
-
Method Details
-
getResults
Prefer theforeach(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
Description copied from interface:EnclosedIterable
Apply the sink to all elements in the Collection.- Specified by:
foreach
in interfaceEnclosedIterable<E extends SharedEntity>
-
size
public int size()- Specified by:
size
in interfaceEnclosedIterable<E extends SharedEntity>
- Specified by:
size
in interfaceSized
- 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 interfaceEnclosedIterable<E extends SharedEntity>
- Specified by:
isEmpty
in interfaceSized
- Returns:
- true if the there is no data behind it.
-
equals
-
hashCode
public int hashCode()
-