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 Details

    • Rating

      public Rating(Double ratingValue, Double bestRating, Integer reviewCount, Profile profile, Boolean isTripadvisor)
      Creates an instance of a Rating record class.
      Parameters:
      ratingValue - the value for the ratingValue record component
      bestRating - the value for the bestRating record component
      reviewCount - the value for the reviewCount record component
      profile - the value for the profile record component
      isTripadvisor - the value for the isTripadvisor 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.
    • ratingValue

      public Double ratingValue()
      Returns the value of the ratingValue record component.
      Returns:
      the value of the ratingValue record component
    • bestRating

      public Double bestRating()
      Returns the value of the bestRating record component.
      Returns:
      the value of the bestRating record component
    • reviewCount

      public Integer reviewCount()
      Returns the value of the reviewCount record component.
      Returns:
      the value of the reviewCount record component
    • profile

      public Profile profile()
      Returns the value of the profile record component.
      Returns:
      the value of the profile record component
    • isTripadvisor

      public Boolean isTripadvisor()
      Returns the value of the isTripadvisor record component.
      Returns:
      the value of the isTripadvisor record component