Record Class Product

java.lang.Object
java.lang.Record
net.ygbstudio.jbrave.core.domain.dto.web.Product
Record Components:
type - The type of the product.
name - The name or title of the product.
category - The category or type of the product.
price - The price of the product as a formatted string.
thumbnail - A thumbnail image representing the product.
description - A description of the product.
offers - A list of offers available for this product.
rating - The rating information for the product.
gtin - The Global Trade Item Number (GTIN) of the product (format may vary).
gtin8 - The 8-digit GTIN of the product.
gtin12 - The 12-digit GTIN (UPC) of the product.
gtin13 - The 13-digit GTIN (EAN) of the product.
gtin14 - The 14-digit GTIN (ITF-14) of the product.

public record Product(String type, String name, String category, String price, Thumbnail thumbnail, String description, List<Offer> offers, Rating rating, String gtin, String gtin8, String gtin12, String gtin13, String gtin14) extends Record
Represents a product in search results, containing detailed information about the product such as its name, category, price, and GTIN identifiers. This is used in the Brave Search API to provide structured data about products that are relevant to the search query.
  • Constructor Details

    • Product

      public Product(String type, String name, String category, String price, Thumbnail thumbnail, String description, List<Offer> offers, Rating rating, String gtin, String gtin8, String gtin12, String gtin13, String gtin14)
      Creates an instance of a Product record class.
      Parameters:
      type - the value for the type record component
      name - the value for the name record component
      category - the value for the category record component
      price - the value for the price record component
      thumbnail - the value for the thumbnail record component
      description - the value for the description record component
      offers - the value for the offers record component
      rating - the value for the rating record component
      gtin - the value for the gtin record component
      gtin8 - the value for the gtin8 record component
      gtin12 - the value for the gtin12 record component
      gtin13 - the value for the gtin13 record component
      gtin14 - the value for the gtin14 record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • category

      public String category()
      Returns the value of the category record component.
      Returns:
      the value of the category record component
    • price

      public String price()
      Returns the value of the price record component.
      Returns:
      the value of the price record component
    • thumbnail

      public Thumbnail thumbnail()
      Returns the value of the thumbnail record component.
      Returns:
      the value of the thumbnail record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • offers

      public List<Offer> offers()
      Returns the value of the offers record component.
      Returns:
      the value of the offers record component
    • rating

      public Rating rating()
      Returns the value of the rating record component.
      Returns:
      the value of the rating record component
    • gtin

      public String gtin()
      Returns the value of the gtin record component.
      Returns:
      the value of the gtin record component
    • gtin8

      public String gtin8()
      Returns the value of the gtin8 record component.
      Returns:
      the value of the gtin8 record component
    • gtin12

      public String gtin12()
      Returns the value of the gtin12 record component.
      Returns:
      the value of the gtin12 record component
    • gtin13

      public String gtin13()
      Returns the value of the gtin13 record component.
      Returns:
      the value of the gtin13 record component
    • gtin14

      public String gtin14()
      Returns the value of the gtin14 record component.
      Returns:
      the value of the gtin14 record component