Record Class ReflectCache.CacheStats

java.lang.Object
java.lang.Record
cloud.opencode.base.reflect.ReflectCache.CacheStats
Record Components:
hitCount - hit count | 命中次数
missCount - miss count | 未命中次数
hitRate - hit rate (0.0 - 1.0) | 命中率
fieldCacheSize - field cache size | 字段缓存大小
methodCacheSize - method cache size | 方法缓存大小
constructorCacheSize - constructor cache size | 构造器缓存大小
typeTokenCacheSize - TypeToken cache size | 类型令牌缓存大小
Enclosing class:
ReflectCache

public static record ReflectCache.CacheStats(long hitCount, long missCount, double hitRate, int fieldCacheSize, int methodCacheSize, int constructorCacheSize, int typeTokenCacheSize) extends Record
Cache Statistics Record 缓存统计记录
Since:
JDK 25, opencode-base-reflect V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • CacheStats

      public CacheStats(long hitCount, long missCount, double hitRate, int fieldCacheSize, int methodCacheSize, int constructorCacheSize, int typeTokenCacheSize)
      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
      hitRate - the value for the hitRate record component
      fieldCacheSize - the value for the fieldCacheSize record component
      methodCacheSize - the value for the methodCacheSize record component
      constructorCacheSize - the value for the constructorCacheSize record component
      typeTokenCacheSize - the value for the typeTokenCacheSize record component
  • Method Details

    • totalSize

      public int totalSize()
      Gets total cache size 获取缓存总大小
      Returns:
      total size | 总大小
    • totalRequests

      public long totalRequests()
      Gets total request count 获取总请求次数
      Returns:
      total requests | 总请求次数
    • 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
    • hitRate

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

      public int fieldCacheSize()
      Returns the value of the fieldCacheSize record component.
      Returns:
      the value of the fieldCacheSize record component
    • methodCacheSize

      public int methodCacheSize()
      Returns the value of the methodCacheSize record component.
      Returns:
      the value of the methodCacheSize record component
    • constructorCacheSize

      public int constructorCacheSize()
      Returns the value of the constructorCacheSize record component.
      Returns:
      the value of the constructorCacheSize record component
    • typeTokenCacheSize

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