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

io.quarkus.cache.runtime.noop.NoOpCache Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.cache.runtime.noop;

import java.util.function.Function;
import java.util.function.Supplier;

import io.quarkus.cache.runtime.AbstractCache;
import io.smallrye.mutiny.Uni;

/**
 * This class is an internal Quarkus cache implementation. Do not use it explicitly from your Quarkus application. The public
 * methods signatures may change without prior notice.
 */
public class NoOpCache extends AbstractCache {

    private static final String NAME = NoOpCache.class.getName();

    @Override
    public String getName() {
        return NAME;
    }

    @Override
    public  Uni get(K key, Function valueLoader) {
        return Uni.createFrom().item(new Supplier() {
            @Override
            public V get() {
                return valueLoader.apply(key);
            }
        });
    }

    @Override
    public Uni invalidate(Object key) {
        return Uni.createFrom().voidItem();
    }

    @Override
    public Uni invalidateAll() {
        return Uni.createFrom().voidItem();
    }

    @Override
    public Uni replaceUniValue(Object key, Object emittedValue) {
        return Uni.createFrom().voidItem();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy