Record Class Book

java.lang.Object
java.lang.Record
net.ygbstudio.jbrave.core.domain.dto.web.Book
Record Components:
title - The title of the book.
author - List of authors who wrote the book.
date - The publication date of the book.
price - The price information of the book.
pages - The number of pages in the book.
publisher - The publisher of the book.
rating - The rating information for the book.

public record Book(String title, List<Person> author, String date, Price price, Integer pages, Person publisher, Rating rating) extends Record
Represents a book in search results, containing detailed information about the book such as its title, authors, publication details, and ratings. This is used in the Brave Search API to provide structured data about books that are relevant to the search query.
  • Constructor Details

    • Book

      public Book(String title, List<Person> author, String date, Price price, Integer pages, Person publisher, Rating rating)
      Creates an instance of a Book record class.
      Parameters:
      title - the value for the title record component
      author - the value for the author record component
      date - the value for the date record component
      price - the value for the price record component
      pages - the value for the pages record component
      publisher - the value for the publisher record component
      rating - the value for the rating 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.
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • author

      public List<Person> author()
      Returns the value of the author record component.
      Returns:
      the value of the author record component
    • date

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

      public Price price()
      Returns the value of the price record component.
      Returns:
      the value of the price record component
    • pages

      public Integer pages()
      Returns the value of the pages record component.
      Returns:
      the value of the pages record component
    • publisher

      public Person publisher()
      Returns the value of the publisher record component.
      Returns:
      the value of the publisher record component
    • rating

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