Record Class StatisticsController.StatisticsSummary

java.lang.Object
java.lang.Record
edu.ucsb.cs156.dining.controllers.StatisticsController.StatisticsSummary
Enclosing class:
StatisticsController

public static record StatisticsController.StatisticsSummary(long totalApprovedReviews, long totalMenuItemsReviewed, long totalCommonsCovered, LocalDateTime lastUpdated) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    StatisticsSummary(long totalApprovedReviews, long totalMenuItemsReviewed, long totalCommonsCovered, LocalDateTime lastUpdated)
    Creates an instance of a StatisticsSummary record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the lastUpdated record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the totalApprovedReviews record component.
    long
    Returns the value of the totalCommonsCovered record component.
    long
    Returns the value of the totalMenuItemsReviewed record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • StatisticsSummary

      public StatisticsSummary(long totalApprovedReviews, long totalMenuItemsReviewed, long totalCommonsCovered, LocalDateTime lastUpdated)
      Creates an instance of a StatisticsSummary record class.
      Parameters:
      totalApprovedReviews - the value for the totalApprovedReviews record component
      totalMenuItemsReviewed - the value for the totalMenuItemsReviewed record component
      totalCommonsCovered - the value for the totalCommonsCovered record component
      lastUpdated - the value for the lastUpdated 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • totalApprovedReviews

      public long totalApprovedReviews()
      Returns the value of the totalApprovedReviews record component.
      Returns:
      the value of the totalApprovedReviews record component
    • totalMenuItemsReviewed

      public long totalMenuItemsReviewed()
      Returns the value of the totalMenuItemsReviewed record component.
      Returns:
      the value of the totalMenuItemsReviewed record component
    • totalCommonsCovered

      public long totalCommonsCovered()
      Returns the value of the totalCommonsCovered record component.
      Returns:
      the value of the totalCommonsCovered record component
    • lastUpdated

      public LocalDateTime lastUpdated()
      Returns the value of the lastUpdated record component.
      Returns:
      the value of the lastUpdated record component