Class SearchResult.Builder

java.lang.Object
net.ygbstudio.jbrave.core.domain.dto.result.Result.Builder
net.ygbstudio.jbrave.core.domain.dto.result.SearchResult.Builder
Direct Known Subclasses:
DiscussionResult.Builder
Enclosing class:
SearchResult

public static class SearchResult.Builder extends Result.Builder
Builder for SearchResult instances.
  • Field Details

    • type

      protected String type
      The result type.
    • subtype

      protected String subtype
      The result subtype.
    • isLive

      protected Boolean isLive
      Whether the result is a live stream.
    • deepResults

      protected DeepResult deepResults
      Deep results associated with this result.
    • schemas

      protected List<List<String>> schemas
      The schema definitions for this result.
    • metaUrl

      protected MetaUrl metaUrl
      The meta URL information for this result.
    • thumbnail

      protected Thumbnail thumbnail
      The thumbnail for this result.
    • age

      protected String age
      The age of the result content.
    • location

      protected LocationResult location
      The location associated with this result.
    • video

      protected VideoData video
      The video data for this result.
    • movie

      protected MovieData movie
      The movie data for this result.
    • faq

      protected FAQ faq
      The FAQ data for this result.
    • qa

      protected QAPage qa
      The Q&A page data for this result.
    • book

      protected Book book
      The book data for this result.
    • rating

      protected Rating rating
      The rating for this result.
    • article

      protected Article article
      The article data for this result.
    • product

      protected ProductPair product
      The primary product for this result.
    • productCluster

      protected List<ProductPair> productCluster
      The cluster of related products.
    • clusterType

      protected String clusterType
      The type of cluster this result belongs to.
    • cluster

      protected List<Result> cluster
      The cluster of results this result belongs to.
    • creativeWork

      protected CreativeWork creativeWork
      The creative work data for this result.
    • musicRecording

      protected MusicRecording musicRecording
      The music recording data for this result.
    • review

      protected Review review
      The review data for this result.
    • software

      protected Software software
      The software data for this result.
    • recipe

      protected Recipe recipe
      The recipe data for this result.
    • organization

      protected Organization organization
      The organization data for this result.
    • contentType

      protected String contentType
      The content type of this result.
    • extraSnippets

      protected List<String> extraSnippets
      Extra snippets for this result.
  • Constructor Details

    • Builder

      public Builder()
      Creates a new builder with all fields unset.
  • Method Details

    • type

      public SearchResult.Builder type(String type)
      Sets the result type.
      Parameters:
      type - the result type
      Returns:
      this builder
    • subtype

      public SearchResult.Builder subtype(String subtype)
      Sets the result subtype.
      Parameters:
      subtype - the result subtype
      Returns:
      this builder
    • isLive

      public SearchResult.Builder isLive(Boolean isLive)
      Sets whether the result is a live stream.
      Parameters:
      isLive - true if the result is live
      Returns:
      this builder
    • deepResults

      public SearchResult.Builder deepResults(DeepResult deepResults)
      Sets the deep results.
      Parameters:
      deepResults - the deep results
      Returns:
      this builder
    • schemas

      public SearchResult.Builder schemas(List<List<String>> schemas)
      Sets the schema definitions.
      Parameters:
      schemas - the schemas
      Returns:
      this builder
    • metaUrl

      public SearchResult.Builder metaUrl(MetaUrl metaUrl)
      Sets the meta URL.
      Parameters:
      metaUrl - the meta URL
      Returns:
      this builder
    • thumbnail

      public SearchResult.Builder thumbnail(Thumbnail thumbnail)
      Sets the thumbnail.
      Parameters:
      thumbnail - the thumbnail
      Returns:
      this builder
    • age

      public SearchResult.Builder age(String age)
      Sets the age of the result.
      Parameters:
      age - the age
      Returns:
      this builder
    • location

      public SearchResult.Builder location(LocationResult location)
      Sets the location.
      Parameters:
      location - the location
      Returns:
      this builder
    • video

      public SearchResult.Builder video(VideoData video)
      Sets the video data.
      Parameters:
      video - the video data
      Returns:
      this builder
    • movie

      public SearchResult.Builder movie(MovieData movie)
      Sets the movie data.
      Parameters:
      movie - the movie data
      Returns:
      this builder
    • faq

      public SearchResult.Builder faq(FAQ faq)
      Sets the FAQ data.
      Parameters:
      faq - the FAQ data
      Returns:
      this builder
    • qa

      public SearchResult.Builder qa(QAPage qa)
      Sets the Q&A page data.
      Parameters:
      qa - the Q&A page data
      Returns:
      this builder
    • book

      public SearchResult.Builder book(Book book)
      Sets the book data.
      Parameters:
      book - the book data
      Returns:
      this builder
    • rating

      public SearchResult.Builder rating(Rating rating)
      Sets the rating.
      Parameters:
      rating - the rating
      Returns:
      this builder
    • article

      public SearchResult.Builder article(Article article)
      Sets the article data.
      Parameters:
      article - the article data
      Returns:
      this builder
    • product

      public SearchResult.Builder product(ProductPair product)
      Sets the primary product.
      Parameters:
      product - the product
      Returns:
      this builder
    • productCluster

      public SearchResult.Builder productCluster(List<ProductPair> productCluster)
      Sets the product cluster.
      Parameters:
      productCluster - the product cluster
      Returns:
      this builder
    • clusterType

      public SearchResult.Builder clusterType(String clusterType)
      Sets the cluster type.
      Parameters:
      clusterType - the cluster type
      Returns:
      this builder
    • cluster

      public SearchResult.Builder cluster(List<Result> cluster)
      Sets the result cluster.
      Parameters:
      cluster - the cluster
      Returns:
      this builder
    • creativeWork

      public SearchResult.Builder creativeWork(CreativeWork creativeWork)
      Sets the creative work data.
      Parameters:
      creativeWork - the creative work data
      Returns:
      this builder
    • musicRecording

      public SearchResult.Builder musicRecording(MusicRecording musicRecording)
      Sets the music recording data.
      Parameters:
      musicRecording - the music recording data
      Returns:
      this builder
    • review

      public SearchResult.Builder review(Review review)
      Sets the review data.
      Parameters:
      review - the review data
      Returns:
      this builder
    • software

      public SearchResult.Builder software(Software software)
      Sets the software data.
      Parameters:
      software - the software data
      Returns:
      this builder
    • recipe

      public SearchResult.Builder recipe(Recipe recipe)
      Sets the recipe data.
      Parameters:
      recipe - the recipe data
      Returns:
      this builder
    • organization

      public SearchResult.Builder organization(Organization organization)
      Sets the organization data.
      Parameters:
      organization - the organization data
      Returns:
      this builder
    • contentType

      public SearchResult.Builder contentType(String contentType)
      Sets the content type.
      Parameters:
      contentType - the content type
      Returns:
      this builder
    • extraSnippets

      public SearchResult.Builder extraSnippets(List<String> extraSnippets)
      Sets the extra snippets.
      Parameters:
      extraSnippets - the extra snippets
      Returns:
      this builder
    • build

      public SearchResult build()
      Builds a new SearchResult from the current builder state.
      Overrides:
      build in class Result.Builder
      Returns:
      a new SearchResult instance