Class 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

    @ExperimentalApi
    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
    • 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 interface com.atlassian.sal.api.search.SearchMatch
      • getExcerpt

        public String getExcerpt()
        Specified by:
        getExcerpt in interface com.atlassian.sal.api.search.SearchMatch
      • getUrl

        public String getUrl()
        Specified by:
        getUrl in interface com.atlassian.sal.api.search.SearchMatch
      • getIconCssClass

        public String getIconCssClass()
      • getLastModified

        public org.joda.time.DateTime getLastModified()
      • getFriendlyLastModified

        public String getFriendlyLastModified()
      • getResultParentContainer

        public ContainerSummary getResultParentContainer()
        Returns:
        the container of this result if it is different to what is returned by getResultGlobalContainer.
        Since:
        5.9
      • 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 interface com.atlassian.sal.api.search.SearchMatch