Record Class StatsController.StatsDTO
java.lang.Object
java.lang.Record
edu.ucsb.cs156.diningcachingproxy.controller.StatsController.StatsDTO
- Enclosing class:
StatsController
public static record StatsController.StatsDTO(long totalRequests, long cacheHits, long cacheMisses, double hitRatePercentage)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionStatsDTO(long totalRequests, long cacheHits, long cacheMisses, double hitRatePercentage) Creates an instance of aStatsDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecacheHitsrecord component.longReturns the value of thecacheMissesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thehitRatePercentagerecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalRequestsrecord component.
-
Constructor Details
-
StatsDTO
public StatsDTO(long totalRequests, long cacheHits, long cacheMisses, double hitRatePercentage) Creates an instance of aStatsDTOrecord class.- Parameters:
totalRequests- the value for thetotalRequestsrecord componentcacheHits- the value for thecacheHitsrecord componentcacheMisses- the value for thecacheMissesrecord componenthitRatePercentage- the value for thehitRatePercentagerecord component
-
-
Method Details
-
toString
-
hashCode
-
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 with thecomparemethod from their corresponding wrapper classes. -
totalRequests
public long totalRequests()Returns the value of thetotalRequestsrecord component.- Returns:
- the value of the
totalRequestsrecord component
-
cacheHits
public long cacheHits()Returns the value of thecacheHitsrecord component.- Returns:
- the value of the
cacheHitsrecord component
-
cacheMisses
public long cacheMisses()Returns the value of thecacheMissesrecord component.- Returns:
- the value of the
cacheMissesrecord component
-
hitRatePercentage
public double hitRatePercentage()Returns the value of thehitRatePercentagerecord component.- Returns:
- the value of the
hitRatePercentagerecord component
-