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 Summary
ConstructorsConstructorDescriptionCacheStats(long hitCount, long missCount, double hitRate, int fieldCacheSize, int methodCacheSize, int constructorCacheSize, int typeTokenCacheSize) Creates an instance of aCacheStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theconstructorCacheSizerecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefieldCacheSizerecord component.final inthashCode()Returns a hash code value for this object.longhitCount()Returns the value of thehitCountrecord component.doublehitRate()Returns the value of thehitRaterecord component.intReturns the value of themethodCacheSizerecord component.longReturns the value of themissCountrecord component.final StringtoString()Returns a string representation of this record class.longGets total request count 获取总请求次数intGets total cache size 获取缓存总大小intReturns the value of thetypeTokenCacheSizerecord component.
-
Constructor Details
-
CacheStats
public CacheStats(long hitCount, long missCount, double hitRate, int fieldCacheSize, int methodCacheSize, int constructorCacheSize, int typeTokenCacheSize) Creates an instance of aCacheStatsrecord class.- Parameters:
hitCount- the value for thehitCountrecord componentmissCount- the value for themissCountrecord componenthitRate- the value for thehitRaterecord componentfieldCacheSize- the value for thefieldCacheSizerecord componentmethodCacheSize- the value for themethodCacheSizerecord componentconstructorCacheSize- the value for theconstructorCacheSizerecord componenttypeTokenCacheSize- the value for thetypeTokenCacheSizerecord 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
-
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. -
hitCount
-
missCount
-
hitRate
-
fieldCacheSize
public int fieldCacheSize()Returns the value of thefieldCacheSizerecord component.- Returns:
- the value of the
fieldCacheSizerecord component
-
methodCacheSize
public int methodCacheSize()Returns the value of themethodCacheSizerecord component.- Returns:
- the value of the
methodCacheSizerecord component
-
constructorCacheSize
public int constructorCacheSize()Returns the value of theconstructorCacheSizerecord component.- Returns:
- the value of the
constructorCacheSizerecord component
-
typeTokenCacheSize
public int typeTokenCacheSize()Returns the value of thetypeTokenCacheSizerecord component.- Returns:
- the value of the
typeTokenCacheSizerecord component
-