Record Class StatisticsController.RatedItem
java.lang.Object
java.lang.Record
edu.ucsb.cs156.dining.controllers.StatisticsController.RatedItem
- Enclosing class:
StatisticsController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionavgStars()Returns the value of theavgStarsrecord component.Returns the value of thediningCommonsCoderecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.itemId()Returns the value of theitemIdrecord component.mealCode()Returns the value of themealCoderecord component.name()Returns the value of thenamerecord component.Returns the value of thereviewCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RatedItem
public RatedItem(Long itemId, String name, String diningCommonsCode, String mealCode, Double avgStars, Long reviewCount) Creates an instance of aRatedItemrecord class.- Parameters:
itemId- the value for theitemIdrecord componentname- the value for thenamerecord componentdiningCommonsCode- the value for thediningCommonsCoderecord componentmealCode- the value for themealCoderecord componentavgStars- the value for theavgStarsrecord componentreviewCount- the value for thereviewCountrecord 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). -
itemId
Returns the value of theitemIdrecord component.- Returns:
- the value of the
itemIdrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
diningCommonsCode
Returns the value of thediningCommonsCoderecord component.- Returns:
- the value of the
diningCommonsCoderecord component
-
mealCode
Returns the value of themealCoderecord component.- Returns:
- the value of the
mealCoderecord component
-
avgStars
Returns the value of theavgStarsrecord component.- Returns:
- the value of the
avgStarsrecord component
-
reviewCount
Returns the value of thereviewCountrecord component.- Returns:
- the value of the
reviewCountrecord component
-