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

com.icthh.xm.commons.request.internal.DataAdapterXmPrivilegedRequestContext Maven / Gradle / Ivy

There is a newer version: 4.0.17
Show newest version
package com.icthh.xm.commons.request.internal;

import com.icthh.xm.commons.request.XmPrivilegedRequestContext;

import java.util.Objects;

/**
 * The {@link DataAdapterXmPrivilegedRequestContext} class.
 */
class DataAdapterXmPrivilegedRequestContext implements XmPrivilegedRequestContext {

    private final XmRequestContextData data;

    DataAdapterXmPrivilegedRequestContext(XmRequestContextData data) {
        this.data = Objects.requireNonNull(data, "data can't be null");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void putValue(String key, Object value) {
        data.putValue(key, value);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void destroyCurrentContext() {
        data.destroyCurrent();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean containsKey(String key) {
        return data.containsKey(key);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public  T getValue(String key, Class type) {
        return data.getValue(key, type);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public  T getValueOrDefault(String key, Class type, T defaultValue) {
        return data.getValueOrDefault(key, type, defaultValue);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy