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 classSearchResult.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)TgetEntity()abstract Reference<T>getEntityRef()StringgetEntityType()StringgetExcerpt()StringgetFriendlyLastModified()StringgetIconCssClass()org.joda.time.DateTimegetLastModified()Deprecated.since 8.6 usegetLastModifiedAt()OffsetDateTimegetLastModifiedAt()com.atlassian.sal.api.search.ResourceTypegetResourceType()ContainerSummarygetResultGlobalContainer()The top level container of the result that is not contained in another container.Reference<ContainerSummary>getResultGlobalContainerRef()ContainerSummarygetResultParent()Deprecated.since 5.9 UsegetResultParentContainer()instead.ContainerSummarygetResultParentContainer()Reference<ContainerSummary>getResultParentRef()StringgetTitle()StringgetUrl()
-
-
-
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:
getTitlein interfacecom.atlassian.sal.api.search.SearchMatch
-
getExcerpt
public String getExcerpt()
- Specified by:
getExcerptin interfacecom.atlassian.sal.api.search.SearchMatch
-
getUrl
public String getUrl()
- Specified by:
getUrlin 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:
getResourceTypein interfacecom.atlassian.sal.api.search.SearchMatch
-
builder
public static <T> SearchResult.Builder<T> builder(T entity)
-
-