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

io.leangen.graphql.spqr.spring.autoconfigure.DefaultGlobalContext Maven / Gradle / Ivy

The newest version!
package io.leangen.graphql.spqr.spring.autoconfigure;

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

public class DefaultGlobalContext {

    private final R nativeRequest;
    private final Map extensions;

    public DefaultGlobalContext(R request) {
        this.nativeRequest = request;
        this.extensions = new ConcurrentHashMap<>();
    }

    public R getNativeRequest() {
        return nativeRequest;
    }

    @SuppressWarnings("unchecked")
    public  T getExtension(Object key) {
        return (T) extensions.get(key);
    }

    @SuppressWarnings("unchecked")
    public  T setExtension(Object key, T value) {
        return (T) extensions.put(key, value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy