Class SearchResultItemImpl<T>

java.lang.Object
org.opencastproject.elasticsearch.impl.SearchResultItemImpl<T>
All Implemented Interfaces:
Comparable<org.opencastproject.elasticsearch.api.SearchResultItem<T>>, org.opencastproject.elasticsearch.api.SearchResultItem<T>

public class SearchResultItemImpl<T> extends Object implements org.opencastproject.elasticsearch.api.SearchResultItem<T>
Default implementation of a SearchResultItem.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
    Score within the search result
    protected T
    Source of the search result
  • Constructor Summary

    Constructors
    Constructor
    Description
    SearchResultItemImpl(double relevance, T source)
    Creates a new search result item with the given uri.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareTo(org.opencastproject.elasticsearch.api.SearchResultItem<T> sr)
     
    boolean
    double
     
    Returns the search result's source.
    int
    void
    setRelevance(double relevance)
    Sets the relevance value, representing the score in the search result.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • source

      protected T source
      Source of the search result
    • score

      protected double score
      Score within the search result
  • Constructor Details

    • SearchResultItemImpl

      public SearchResultItemImpl(double relevance, T source)
      Creates a new search result item with the given uri. The source is the object that created the item, usually, this will be the site itself but it could very well be a module that added to a search result.
      Parameters:
      relevance - the score inside the search result
      source - the object that produced the result item
  • Method Details

    • setRelevance

      public void setRelevance(double relevance)
      Sets the relevance value, representing the score in the search result.
      Parameters:
      relevance - the relevance value
    • getRelevance

      public double getRelevance()
      Specified by:
      getRelevance in interface org.opencastproject.elasticsearch.api.SearchResultItem<T>
      See Also:
      • SearchResultItem.getRelevance()
    • getSource

      public T getSource()
      Returns the search result's source.
      Specified by:
      getSource in interface org.opencastproject.elasticsearch.api.SearchResultItem<T>
      See Also:
      • SearchResultItem.getSource()
    • compareTo

      public int compareTo(org.opencastproject.elasticsearch.api.SearchResultItem<T> sr)
      Specified by:
      compareTo in interface Comparable<T>
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: