Class SearchResult<T>
- java.lang.Object
-
- com.atlassian.confluence.api.model.search.SearchResult<T>
-
- Type Parameters:
T
- entityRef type - the type of the wrapped result
- All Implemented Interfaces:
com.atlassian.sal.api.search.SearchMatch
- Direct Known Subclasses:
ContentSearchResult
,SpaceSearchResult
,UserSearchResult
public abstract class SearchResult<T> extends Object implements com.atlassian.sal.api.search.SearchMatch
A result of a search. SearchResult is a adapter around another result entity to make representing polymorphic search results simpler. The original entity is available via the getEntity() method
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchResult.Builder<T>
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> SearchResult.Builder<T>
builder(T entity)
T
getEntity()
abstract Reference<T>
getEntityRef()
String
getEntityType()
String
getExcerpt()
String
getFriendlyLastModified()
String
getIconCssClass()
org.joda.time.DateTime
getLastModified()
Deprecated.since 8.6 usegetLastModifiedAt()
OffsetDateTime
getLastModifiedAt()
com.atlassian.sal.api.search.ResourceType
getResourceType()
ContainerSummary
getResultGlobalContainer()
The top level container of the result that is not contained in another container.Reference<ContainerSummary>
getResultGlobalContainerRef()
ContainerSummary
getResultParent()
Deprecated.since 5.9 UsegetResultParentContainer()
instead.ContainerSummary
getResultParentContainer()
Reference<ContainerSummary>
getResultParentRef()
String
getTitle()
String
getUrl()
-
-
-
Method Detail
-
getEntity
public T getEntity()
-
getEntityRef
public abstract Reference<T> getEntityRef()
- Returns:
- a reference to the result entity that this searchResult wraps.
-
getEntityType
public final String getEntityType()
-
getTitle
public String getTitle()
- Specified by:
getTitle
in interfacecom.atlassian.sal.api.search.SearchMatch
-
getExcerpt
public String getExcerpt()
- Specified by:
getExcerpt
in interfacecom.atlassian.sal.api.search.SearchMatch
-
getUrl
public String getUrl()
- Specified by:
getUrl
in interfacecom.atlassian.sal.api.search.SearchMatch
-
getIconCssClass
public String getIconCssClass()
-
getLastModified
@Deprecated public org.joda.time.DateTime getLastModified()
Deprecated.since 8.6 usegetLastModifiedAt()
-
getLastModifiedAt
public OffsetDateTime getLastModifiedAt()
- Since:
- 8.6
-
getFriendlyLastModified
public String getFriendlyLastModified()
-
getResultParentRef
public Reference<ContainerSummary> getResultParentRef()
-
getResultParent
@Deprecated public ContainerSummary getResultParent()
Deprecated.since 5.9 UsegetResultParentContainer()
instead.- Returns:
- the container of this result if it is different to what is returned by getResultGlobalContainer.
-
getResultParentContainer
public ContainerSummary getResultParentContainer()
- Returns:
- the container of this result if it is different to what is returned by getResultGlobalContainer.
- Since:
- 5.9
-
getResultGlobalContainerRef
public Reference<ContainerSummary> getResultGlobalContainerRef()
-
getResultGlobalContainer
public ContainerSummary getResultGlobalContainer()
The top level container of the result that is not contained in another container.For example, if this result referenced a comment, a comment is contained in a page, and a page is contained in a space, but a space is not contained in another entity. This method would return a summary of the space.
-
getResourceType
public com.atlassian.sal.api.search.ResourceType getResourceType()
- Specified by:
getResourceType
in interfacecom.atlassian.sal.api.search.SearchMatch
-
builder
public static <T> SearchResult.Builder<T> builder(T entity)
-
-