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

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

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

import io.github.anicolaspp.Hx.BreakerSupplier;
import io.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