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

com.icthh.xm.lep.core.DefaultContext Maven / Gradle / Ivy

There is a newer version: 4.0.21
Show newest version
package com.icthh.xm.lep.core;

import com.icthh.xm.lep.api.Context;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

@Deprecated(forRemoval = true)
public class DefaultContext implements Context {

    private final Map values = new HashMap<>();

    @Override
    public Set getNames() {
        return Collections.unmodifiableSet(values.keySet());
    }

    @Override
    public boolean contains(String name) {
        return values.containsKey(name);
    }

    @Override
    public Object getValue(String name) {
        return values.get(name);
    }

    @Override
    public  T getValue(String name, Class castToType) {
        return castToType.cast(getValue(name));
    }

    @Override
    public void setValue(String name, Object value) {
        values.put(name, value);
    }

    @Override
    public Map getValues() {
        return Collections.unmodifiableMap(values);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy