Class NewsResult.Builder

java.lang.Object
net.ygbstudio.jbrave.core.domain.dto.result.Result.Builder
net.ygbstudio.jbrave.core.domain.dto.result.NewsResult.Builder
Enclosing class:
NewsResult

public static final class NewsResult.Builder extends Result.Builder
Builder for NewsResult instances.
  • Constructor Details

    • Builder

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

    • metaUrl

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

      public NewsResult.Builder source(String source)
      Sets the source.
      Parameters:
      source - the source
      Returns:
      this builder
    • breaking

      public NewsResult.Builder breaking(Boolean breaking)
      Sets whether the news is breaking.
      Parameters:
      breaking - true if breaking
      Returns:
      this builder
    • isLive

      public NewsResult.Builder isLive(Boolean isLive)
      Sets whether the news is live.
      Parameters:
      isLive - true if live
      Returns:
      this builder
    • thumbnail

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

      public NewsResult.Builder age(String age)
      Sets the age of the news.
      Parameters:
      age - the age
      Returns:
      this builder
    • extraSnippets

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

      @Contract(" -> new") @NotNull public @NotNull NewsResult build()
      Builds a new NewsResult from the current builder state.
      Overrides:
      build in class Result.Builder
      Returns:
      a new NewsResult instance