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.- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthor()Returns the value of theauthorrecord component.date()Returns the value of thedaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.pages()Returns the value of thepagesrecord component.price()Returns the value of thepricerecord component.Returns the value of thepublisherrecord component.rating()Returns the value of theratingrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Book
public Book(String title, List<Person> author, String date, Price price, Integer pages, Person publisher, Rating rating) Creates an instance of aBookrecord class.- Parameters:
title- the value for thetitlerecord componentauthor- the value for theauthorrecord componentdate- the value for thedaterecord componentprice- the value for thepricerecord componentpages- the value for thepagesrecord componentpublisher- the value for thepublisherrecord componentrating- the value for theratingrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
author
Returns the value of theauthorrecord component.- Returns:
- the value of the
authorrecord component
-
date
Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
price
Returns the value of thepricerecord component.- Returns:
- the value of the
pricerecord component
-
pages
Returns the value of thepagesrecord component.- Returns:
- the value of the
pagesrecord component
-
publisher
Returns the value of thepublisherrecord component.- Returns:
- the value of the
publisherrecord component
-
rating
Returns the value of theratingrecord component.- Returns:
- the value of the
ratingrecord component
-