cache-bucket

Light weight in-memory cache bucket

Лицензия

Лицензия

Группа

Группа

com.github.sats17
Идентификатор

Идентификатор

cache-bucket
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

cache-bucket
Light weight in-memory cache bucket
Ссылка на сайт

Ссылка на сайт

https://github.com/sats17/cache-bucket
Система контроля версий

Система контроля версий

https://github.com/sats17/cache-bucket/

Скачать cache-bucket

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.sats17/cache-bucket/ -->
<dependency>
    <groupId>com.github.sats17</groupId>
    <artifactId>cache-bucket</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.sats17/cache-bucket/
implementation 'com.github.sats17:cache-bucket:1.0.0'
// https://jarcasting.com/artifacts/com.github.sats17/cache-bucket/
implementation ("com.github.sats17:cache-bucket:1.0.0")
'com.github.sats17:cache-bucket:jar:1.0.0'
<dependency org="com.github.sats17" name="cache-bucket" rev="1.0.0">
  <artifact name="cache-bucket" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.sats17', module='cache-bucket', version='1.0.0')
)
libraryDependencies += "com.github.sats17" % "cache-bucket" % "1.0.0"
[com.github.sats17/cache-bucket "1.0.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.jsmart : zerocode-tdd-jupiter jar 1.3.27

Модули Проекта

Данный проект не имеет модулей.

Actions Status Coverage Quality Gate Status License

Cache-Bucket

In memory cache bucket, used to store server side cache

Versions

cache-bucket
1.0.0

Maven Dependency

<dependency>
  <groupId>com.github.sats17</groupId>
  <artifactId>cache-bucket</artifactId>
  <version>1.0.0</version>
</dependency>

Required Imports

import com.github.sats17.cache.extern.CacheBucket;
import com.github.sats17.cache.internal.services.BucketController;

Initialize bucket with size

int size = 100;
CacheBucket bucket = new BucketController(size);

Initialize bucket with size and TTL

int size = 100;
long ttl = 60000; // 60 seconds
CacheBucket bucket = new BucketController(size, ttl);

Set cache

String key = "cacheKey";
Object value = new Object();
bucket.setCache(key, value);

Retrieve cache by key

Object value = bucket.getCache(key); 
note : By default get cache method returns cache value type as Object, You need to explicitly cast the value according to your use
CacheBucket bucket = new BucketController(10,100000);
bucket.setCache("key", "cacheValue");
String value = (String) bucket.getCache("test");

Retrieve all cache from bucket

Map<String, Object> values = bucket.getAll();

Clear cache by key

bucket.clear(key);

Clear all cache from bucket

bucket.clear();

Demo project

https://github.com/sats17/cache-bucket-demo

Версии библиотеки

Версия
1.0.0