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

com.fluxtion.server.plugin.cache.InMemoryCache Maven / Gradle / Ivy

There is a newer version: 0.1.44
Show newest version
/*
 * SPDX-FileCopyrightText: © 2025 Gregory Higgins 
 * SPDX-License-Identifier: AGPL-3.0-only
 */

package com.fluxtion.server.plugin.cache;

import lombok.Getter;

import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Getter
public class InMemoryCache implements Cache {

    private final Map cache = new ConcurrentHashMap<>();

    @Override
    public Collection keys() {
        return cache.keySet();
    }

    @Override
    public void put(String key, Object value) {
        cache.put(key, value);
    }

    @Override
    @SuppressWarnings("unchecked")
    public  T get(String key) {
        return (T) cache.get(key);
    }

    @Override
    public void remove(String key) {
        cache.remove(key);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy