All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.rsqn.cacheservice.support.CacheKeyGenerator Maven / Gradle / Ivy

package tech.rsqn.cacheservice.support;

import tech.rsqn.cacheservice.TransparentCacheService;

import java.util.List;

public abstract class CacheKeyGenerator {
    public boolean supportsEntity(Object entity) {
        return supportsClass(entity.getClass());
    }

    public boolean supportsClass(Class clazz) {
        List supported = getSupportedClasses();

        for (Class aClass : supported) {
            if (clazz.equals(aClass)) {
                return true;
            }
        }

        return false;
    }

    public abstract List getSupportedClasses();

    public abstract String generateKey(TransparentCacheService service,
        Class clazz, Object... params);

    public abstract String generateKey(T entity);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy