Record Class Rating
java.lang.Object
java.lang.Record
net.ygbstudio.jbrave.core.domain.dto.web.Rating
- Record Components:
ratingValue- The numerical rating value, typically on a scale defined by bestRating.bestRating- The highest possible rating in the rating system (e.g., 5.0, 10.0).reviewCount- The total number of reviews or ratings that contributed to this rating.profile- Information about the entity being rated, including name and other details.isTripadvisor- Indicates whether this rating is specifically from TripAdvisor.
public record Rating(Double ratingValue, Double bestRating, Integer reviewCount, Profile profile, Boolean isTripadvisor)
extends Record
Represents rating information for various entities in search results, such as products,
businesses, or services. This is used to provide structured rating data in the Brave Search API
responses.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebestRatingrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theisTripadvisorrecord component.profile()Returns the value of theprofilerecord component.Returns the value of theratingValuerecord component.Returns the value of thereviewCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Rating
public Rating(Double ratingValue, Double bestRating, Integer reviewCount, Profile profile, Boolean isTripadvisor) Creates an instance of aRatingrecord class.- Parameters:
ratingValue- the value for theratingValuerecord componentbestRating- the value for thebestRatingrecord componentreviewCount- the value for thereviewCountrecord componentprofile- the value for theprofilerecord componentisTripadvisor- the value for theisTripadvisorrecord 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). -
ratingValue
Returns the value of theratingValuerecord component.- Returns:
- the value of the
ratingValuerecord component
-
bestRating
Returns the value of thebestRatingrecord component.- Returns:
- the value of the
bestRatingrecord component
-
reviewCount
Returns the value of thereviewCountrecord component.- Returns:
- the value of the
reviewCountrecord component
-
profile
Returns the value of theprofilerecord component.- Returns:
- the value of the
profilerecord component
-
isTripadvisor
Returns the value of theisTripadvisorrecord component.- Returns:
- the value of the
isTripadvisorrecord component
-