/*
* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
* This source file is part of the Cangjie project, licensed under Apache-2.0
* with Runtime Library Exception.
*
* See https://cangjie-lang.cn/pages/LICENSE for license information.
*/
/**
* @file i_cache_config.cj
* @brief Interface for Defining Cache Object Attributes
*
*/
package stdx.string_intern
interface ICacheConfig {
prop maxObjects: Int64
prop cacheName: String
prop spoolChunkSize: Int64
prop evictionType: CacheEvictionType
}
class DefaultCacheConfig <: ICacheConfig {
protected var _maxObjects: Int64
protected var _cacheName: String
protected var _spoolChunkSize: Int64
protected var _evictionType: CacheEvictionType
public prop maxObjects: Int64 {
get() {
return _maxObjects
}
}
public prop cacheName: String {
get() {
return _cacheName
}
}
public prop spoolChunkSize: Int64 {
get() {
return _spoolChunkSize
}
}
public prop evictionType: CacheEvictionType {
get() {
return _evictionType
}
}
init(maxObjects!: Int64 = 0, cacheName!: String = "", spoolChunkSize!: Int64 = 2,
evictionType!: CacheEvictionType = CacheEvictionType.LRU) {
this._maxObjects = maxObjects
this._cacheName = cacheName
this._spoolChunkSize = spoolChunkSize
this._evictionType = evictionType
}
}