![JAR search and dependency download from the Maven repository](/logo.png)
com.github.bootfastconfig.cache.redis.RedisBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boot-fast-config-cache Show documentation
Show all versions of boot-fast-config-cache Show documentation
Parent pom providing dependency and plugin management for applications
built with Maven
The newest version!
package com.github.bootfastconfig.cache.redis;
import com.github.bootfastconfig.cache.CacheBuilder;
import com.github.bootfastconfig.cache.Duration;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import java.util.concurrent.TimeUnit;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RedisBuilder implements CacheBuilder {
private String name;
private Duration expireAfterAccess = new Duration(120, TimeUnit.SECONDS);
private RedisCacheConfiguration defaultCacheConfig;
@Override
public RedisCacheConfiguration get() {
TimeUnit unit = expireAfterAccess.getUnit();
return defaultCacheConfig.entryTtl(java.time.Duration.ofSeconds(unit.toSeconds(expireAfterAccess.getDuration())));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy