Record Class CacheQuery.Result<K,V>
java.lang.Object
java.lang.Record
cloud.opencode.base.cache.query.CacheQuery.Result<K,V>
- Type Parameters:
K- key type | 键类型V- value type | 值类型- Record Components:
entries- the matched entries | 匹配的条目totalInCache- the total entries in cache | 缓存中的总条目数skipped- the number of skipped entries | 跳过的条目数limit- the query limit | 查询限制executionTimeNanos- the execution time in nanoseconds | 执行时间(纳秒)
- Enclosing class:
CacheQuery<K,V>
public static record CacheQuery.Result<K,V> (List<Map.Entry<K,V>> entries, long totalInCache, long skipped, long limit, long executionTimeNanos)
extends Record
Query result containing matched entries and metadata
包含匹配条目和元数据的查询结果
- Since:
- JDK 25, opencode-base-cache V2.0.5
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleGet execution time in milliseconds 获取执行时间(毫秒)longReturns the value of theexecutionTimeNanosrecord component.final inthashCode()Returns a hash code value for this object.booleanhasMore()Check if there are more results 检查是否有更多结果booleanisEmpty()Check if empty 检查是否为空keys()Get keys only 仅获取键longlimit()Returns the value of thelimitrecord component.intsize()Get result size 获取结果大小longskipped()Returns the value of theskippedrecord component.toMap()Convert to map 转换为 Mapfinal StringtoString()Returns a string representation of this record class.longReturns the value of thetotalInCacherecord component.values()Get values only 仅获取值
-
Constructor Details
-
Result
public Result(List<Map.Entry<K, V>> entries, long totalInCache, long skipped, long limit, long executionTimeNanos) Creates an instance of aResultrecord class.- Parameters:
entries- the value for theentriesrecord componenttotalInCache- the value for thetotalInCacherecord componentskipped- the value for theskippedrecord componentlimit- the value for thelimitrecord componentexecutionTimeNanos- the value for theexecutionTimeNanosrecord component
-
-
Method Details
-
size
public int size()Get result size 获取结果大小- Returns:
- result size | 结果大小
-
isEmpty
public boolean isEmpty()Check if empty 检查是否为空- Returns:
- true if empty | 如果为空返回 true
-
keys
-
values
-
toMap
-
executionTimeMs
public double executionTimeMs()Get execution time in milliseconds 获取执行时间(毫秒)- Returns:
- execution time ms | 执行时间毫秒
-
hasMore
public boolean hasMore()Check if there are more results 检查是否有更多结果- Returns:
- true if more results exist | 如果有更多结果返回 true
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
entries
-
totalInCache
public long totalInCache()Returns the value of thetotalInCacherecord component.- Returns:
- the value of the
totalInCacherecord component
-
skipped
-
limit
-
executionTimeNanos
public long executionTimeNanos()Returns the value of theexecutionTimeNanosrecord component.- Returns:
- the value of the
executionTimeNanosrecord component
-