Class WebSearchInformationResult

  • All Implemented Interfaces:

    
    public class WebSearchInformationResult
    
                        

    Represents general information about the web search performed. This includes the total number of results, the page number, and metadata.

    The total number of results is the total number of web pages that are found by the search engine in response to a search query. The page number is the current page number of the search results. The metadata is a map of key-value pairs that provide additional information about the search. For example, it could include the search query, the search engine used, the time it took to perform the search, etc.

    • Constructor Detail

      • WebSearchInformationResult

        WebSearchInformationResult(Long totalResults)
        Constructs a new WebSearchInformationResult with the specified total results.
        Parameters:
        totalResults - The total number of results.
      • WebSearchInformationResult

        WebSearchInformationResult(Long totalResults, Integer pageNumber, Map<String, Object> metadata)
        Constructs a new WebSearchInformationResult with the specified total results, page number, and metadata.
        Parameters:
        totalResults - The total number of results.
        pageNumber - The page number.
        metadata - The metadata.
    • Method Detail

      • totalResults

         Long totalResults()

        Gets the total number of results.

        Returns:

        The total number of results.

      • from

         static WebSearchInformationResult from(Long totalResults)

        Creates a new WebSearchInformationResult with the specified total results.

        Parameters:
        totalResults - The total number of results.
        Returns:

        The new WebSearchInformationResult.

      • from

         static WebSearchInformationResult from(Long totalResults, Integer pageNumber, Map<String, Object> metadata)

        Creates a new WebSearchInformationResult with the specified total results, page number, and metadata.

        Parameters:
        totalResults - The total number of results.
        pageNumber - The page number.
        metadata - The metadata.
        Returns:

        The new WebSearchInformationResult.