Record Class MultiLevelCache.LevelConfig<K,V>
java.lang.Object
java.lang.Record
cloud.opencode.base.cache.multilevel.MultiLevelCache.LevelConfig<K,V>
- Type Parameters:
K- the key type | 键类型V- the value type | 值类型- Record Components:
name- the level name | 级别名称cache- the cache instance for this level | 此级别的缓存实例ttl- the time-to-live for this level | 此级别的过期时间promoteOnHit- whether to promote entries on hit | 命中时是否提升条目writeEnabled- whether writes are enabled for this level | 此级别是否启用写入
- Enclosing class:
MultiLevelCache<K,V>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> MultiLevelCache.LevelConfigBuilder <K, V> builder()Creates a new level config builder | 创建新的级别配置构建器cache()Returns the value of thecacherecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.booleanReturns the value of thepromoteOnHitrecord component.final StringtoString()Returns a string representation of this record class.ttl()Returns the value of thettlrecord component.booleanReturns the value of thewriteEnabledrecord component.
-
Constructor Details
-
LevelConfig
public LevelConfig(String name, Cache<K, V> cache, Duration ttl, boolean promoteOnHit, boolean writeEnabled) Creates an instance of aLevelConfigrecord class.- Parameters:
name- the value for thenamerecord componentcache- the value for thecacherecord componentttl- the value for thettlrecord componentpromoteOnHit- the value for thepromoteOnHitrecord componentwriteEnabled- the value for thewriteEnabledrecord component
-
-
Method Details
-
builder
Creates a new level config builder | 创建新的级别配置构建器- Type Parameters:
K- the key type | 键类型V- the value type | 值类型- Returns:
- a new builder | 新的构建器
-
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. -
name
-
cache
-
ttl
-
promoteOnHit
public boolean promoteOnHit()Returns the value of thepromoteOnHitrecord component.- Returns:
- the value of the
promoteOnHitrecord component
-
writeEnabled
public boolean writeEnabled()Returns the value of thewriteEnabledrecord component.- Returns:
- the value of the
writeEnabledrecord component
-