Class GeckoSession.Recommendation.Builder

Object
org.mozilla.geckoview.GeckoSession.Recommendation.Builder
Enclosing class:
GeckoSession.Recommendation

public static class GeckoSession.Recommendation.Builder extends Object
This is a Builder used by Recommendation class
  • Constructor Details

    • Builder

      public Builder(@NonNull String recommendationUrl)
      Construct a Builder instance with the specified recommendation URL.
      Parameters:
      recommendationUrl - A URI String.
  • Method Details

    • analysisUrl

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder analysisUrl(@NonNull String analysisUrl)
      Set the analysis URL
      Parameters:
      analysisUrl - A URI String
      Returns:
      This Builder instance.
    • adjustedRating

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder adjustedRating(@NonNull Double adjustedRating)
      Set the adjusted rating
      Parameters:
      adjustedRating - the adjusted rating of the product
      Returns:
      This Builder instance.
    • sponsored

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder sponsored(@NonNull Boolean sponsored)
      Set the flag that indicates whether this recommendation is sponsored or not
      Parameters:
      sponsored - indicates whether this recommendation is sponsored
      Returns:
      This Builder instance.
    • imageUrl

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder imageUrl(@NonNull String imageUrl)
      Set the image URL
      Parameters:
      imageUrl - An image URL String
      Returns:
      This Builder instance.
    • aid

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder aid(@NonNull String aid)
      Set the ad identifier
      Parameters:
      aid - The id String
      Returns:
      This Builder instance.
    • url

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder url(@NonNull String url)
      Set the recommendation URL
      Parameters:
      url - A URI String
      Returns:
      This Builder instance.
    • name

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder name(@NonNull String name)
      Set the name of the recommended product
      Parameters:
      name - A name String
      Returns:
      This Builder instance.
    • grade

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder grade(@NonNull String grade)
      Set the grade of the recommended product
      Parameters:
      grade - A grade String
      Returns:
      This Builder instance.
    • price

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder price(@NonNull String price)
      Set the price of the recommended product
      Parameters:
      price - A price String
      Returns:
      This Builder instance.
    • currency

      @AnyThread @NonNull public GeckoSession.Recommendation.Builder currency(@NonNull String currency)
      Set the currency of the price of the recommended product
      Parameters:
      currency - A currency String
      Returns:
      This Builder instance.
    • build

      @AnyThread @NonNull public GeckoSession.Recommendation build()
      Returns:
      A GeckoSession.Recommendation constructed with the values from this Builder instance.