Class SearchResults<T>

  • Type Parameters:
    T - The type of objects
    All Implemented Interfaces:
    java.io.Serializable

    public class SearchResults<T>
    extends java.lang.Object
    implements java.io.Serializable
    Stands for objects of a search. This object allows to encapsulate both the objects of a search and the total number which can be different according to pagination
    Author:
    Christopher Laszczuk
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SearchResults()  
      SearchResults​(java.util.List<T> objects, long found)  
      SearchResults​(java.util.List<T> objects, long found, long duration)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getDuration()  
      long getFound()
      Gets the total number of found results
      java.util.List<T> getObjects()
      Gets the objects of represented search
      void setDuration​(long duration)  
      void setFound​(long found)  
      void setObjects​(java.util.List<T> results)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SearchResults

        public SearchResults()
      • SearchResults

        public SearchResults​(java.util.List<T> objects,
                             long found)
      • SearchResults

        public SearchResults​(java.util.List<T> objects,
                             long found,
                             long duration)
    • Method Detail

      • getObjects

        public java.util.List<T> getObjects()
        Gets the objects of represented search
        Returns:
        A list of search objects
      • setObjects

        public void setObjects​(java.util.List<T> results)
      • getFound

        public long getFound()
        Gets the total number of found results
        Returns:
        The found number
      • setFound

        public void setFound​(long found)
      • getDuration

        public long getDuration()
      • setDuration

        public void setDuration​(long duration)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object