# Record Class ModernSearchCache.CacheStats

java.lang.Object
java.lang.Record
com.university.bookstore.search.ModernSearchCache.CacheStats

Record Components:
  `hitCount` - number of cache hits
  `missCount` - number of cache misses
  `evictionCount` - number of cache evictions
  `loadCount` - number of cache loads
  `hitRate` - cache hit rate (0.0 to 1.0)
  `averageLoadTime` - average time to load data
  `size` - current cache size
  `totalAccessCount` - total number of cache accesses

Enclosing class:
  `ModernSearchCache`

public static record ModernSearchCache.CacheStats(long hitCount, long missCount, long evictionCount, long loadCount, double hitRate, double averageLoadTime, int size, long totalAccessCount) extends Record
Cache statistics record.

Since:
  2024-09-15
Version:
  4.0
Author:
  Navid Mohaghegh

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CacheStats(long hitCount, long missCount, long evictionCount, long loadCount, double hitRate, double averageLoadTime, int size, long totalAccessCount)`
  Creates an instance of a `CacheStats` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `averageLoadTime()`
  Returns the value of the `averageLoadTime` record component.
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `long`
  `evictionCount()`
  Returns the value of the `evictionCount` record component.
  `String`
  `getSummary()`
  Creates a summary string.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `long`
  `hitCount()`
  Returns the value of the `hitCount` record component.
  `double`
  `hitRate()`
  Returns the value of the `hitRate` record component.
  `long`
  `loadCount()`
  Returns the value of the `loadCount` record component.
  `long`
  `missCount()`
  Returns the value of the `missCount` record component.
  `int`
  `size()`
  Returns the value of the `size` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.
  `long`
  `totalAccessCount()`
  Returns the value of the `totalAccessCount` record component.

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CacheStats

    public CacheStats(long hitCount, long missCount, long evictionCount, long loadCount, double hitRate, double averageLoadTime, int size, long totalAccessCount)
    Creates an instance of a `CacheStats` record class.
    Parameters:
      `hitCount` - the value for the `hitCount` record component
      `missCount` - the value for the `missCount` record component
      `evictionCount` - the value for the `evictionCount` record component
      `loadCount` - the value for the `loadCount` record component
      `hitRate` - the value for the `hitRate` record component
      `averageLoadTime` - the value for the `averageLoadTime` record component
      `size` - the value for the `size` record component
      `totalAccessCount` - the value for the `totalAccessCount` record component

- ## Method Details

  - ### getSummary

    public String getSummary()
    Creates a summary string.

  - ### 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 the `compare` method from their corresponding wrapper classes.
    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.

  - ### hitCount

    public long hitCount()
    Returns the value of the `hitCount` record component.
    Returns:
      the value of the `hitCount` record component

  - ### missCount

    public long missCount()
    Returns the value of the `missCount` record component.
    Returns:
      the value of the `missCount` record component

  - ### evictionCount

    public long evictionCount()
    Returns the value of the `evictionCount` record component.
    Returns:
      the value of the `evictionCount` record component

  - ### loadCount

    public long loadCount()
    Returns the value of the `loadCount` record component.
    Returns:
      the value of the `loadCount` record component

  - ### hitRate

    public double hitRate()
    Returns the value of the `hitRate` record component.
    Returns:
      the value of the `hitRate` record component

  - ### averageLoadTime

    public double averageLoadTime()
    Returns the value of the `averageLoadTime` record component.
    Returns:
      the value of the `averageLoadTime` record component

  - ### size

    public int size()
    Returns the value of the `size` record component.
    Returns:
      the value of the `size` record component

  - ### totalAccessCount

    public long totalAccessCount()
    Returns the value of the `totalAccessCount` record component.
    Returns:
      the value of the `totalAccessCount` record component