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

com.github.anicolaspp.Hx.commands.CacheCommandWithFallback Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package com.github.anicolaspp.Hx.commands;

import com.github.anicolaspp.Hx.BreakerSupplier;
import com.github.anicolaspp.Hx.RequestContextInitializer;

import java.util.function.Supplier;

class CacheCommandWithFallback extends CommandWithFallback implements RequestContextInitializer {
    
    private final String key;
    
    CacheCommandWithFallback(String key, BreakerSupplier supplier,
                             Supplier fallback,
                             Setter setter) {
        
        super(supplier, fallback, setter);
        this.key = key;
    
        initializeRequestContext();
    }
    
    @Override
    protected String getCacheKey() {
        return key;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy